TagBuilder Pattern Methods
Returns: TagBuilder<HTMLElement>
Alias for element.setAttribute()
Returns: TagBuilder<HTMLElement>
Assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value
Returns: TagBuilder<HTMLElement>
An integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position
Returns: TagBuilder<HTMLElement>
Inserts a set of tag builder objects or DOMString objects after the last child of the Element. DOMString objects are inserted as equivalent Text nodes
-
Arguments
child: ...(html | TagBuilder)[]
-
Usage
//example using plain text
new TagBuilder('div').append('foobar foobaz foodad');
//example using a tag builder object
new TagBuilder('div').append(new TagBuilder('div').innerHTML('foobar'));
//data types can be used in tandem:
new TagBuilder('div').append('foobar', new TagBuilder('div').innerHTML('foodad'));
- See also:
Returns: TagBuilder<HTMLElement>
Inserts a set of tag builder objects or DOMString objects before the first child of the Element. DOMString objects are inserted as equivalent Text nodes
-
Arguments
child: ...(html | TagBuilder)[]
-
Usage
//example using plain text
new TagBuilder('div').prepend('foobar foobaz foodad');
//example using a tag builder object
new TagBuilder('div').prepend(new TagBuilder('div').innerHTML('foobar'));
//data types can be used in tandem:
new TagBuilder('div').prepend('foobar', new TagBuilder('div').innerHTML('foodad'));
- See also:
Returns: TagBuilder<HTMLElement>
Insert a sibling adjacent to the owning element. This is only guaranteed to work in `headless` mode
Returns: TagBuilder<HTMLElement>
A DOMString containing the HTML serialization of the element's descendants. Setting the value of innerHTML removes all of the element's descendants and replaces them with nodes constructed by parsing the HTML given in the string htmlString
Returns: TagBuilder<HTMLElement>
Set the width and height css properties of the element using CSS values
Returns: TagBuilder<HTMLElement>
Add classes to the element
Returns: TagBuilder<HTMLElement>
Set the height of the element
Returns: TagBuilder<HTMLElement>
CSS margin short-hand equivalent rest parameters. This behaves exactly like you would use in CSS files
-
Arguments
...cssShorthand: string[]
-
Usage
//apply to all sides:
new TagBuilder('div').margin('5px'); //CSS equivalent = margin: 5px;
//apply to vertical | horizontal
new TagBuilder('div').margin('5px', '10px'); //CSS equivalent = margin: 5px 10px;
//apply to top | horizontal | bottom
new TagBuilder('div').margin('5px', '10px', '8px'); //CSS equivalent = margin: 5px 10px 8px;
//apply to top | right | bottom | left
new TagBuilder('div').margin('5px', '6px', '7px', '8px'); //CSS equivalent = margin: 5px 6px 7px 8px;
- See also:
Returns: TagBuilder<HTMLElement>
Set position properties using CSS values. If the argmuents are null or undefined they will be ignored
-
Arguments
top?: string
right?: string
bottom?: string
left?: string
-
Usage
//setting the left property ignoring the rest
new TagBuilder('div').origin(null, null, null, '-10px'); //CSS equivalent = left: -10px;
Returns: TagBuilder<HTMLElement>
CSS padding short-hand equivalent rest parameters. This behaves exactly like you would use in CSS files
-
Arguments
...cssShorthand: string[]
-
Usage
//apply to all sides:
new TagBuilder('div').padding('5px'); //CSS equivalent = padding: 5px;
//apply to vertical | horizontal
new TagBuilder('div').padding('5px', '10px'); //CSS equivalent = padding: 5px 10px;
//apply to top | horizontal | bottom
new TagBuilder('div').padding('5px', '10px', '8px'); //CSS equivalent = padding: 5px 10px 8px;
//apply to top | right | bottom | left
new TagBuilder('div').padding('5px', '6px', '7px', '8px'); //CSS equivalent = padding: 5px 6px 7px 8px;
- See also:
Returns: TagBuilder<HTMLElement>
Sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements
Returns: TagBuilder<HTMLElement>
CSS property-value pairs. Each property/value pair you provide is validated against using the users agents native window.CSS.supports()
method. Anything that is not supported will be ignored
Notice how the usage example demonstrates the names of the CSS properties are not the javascript camelcase variants, they are the CSS property names as-is
-
Arguments
obj: { [key: string]: string | number | boolean }
-
Usage
new TagBuilder('div').style({
'padding-left': '20px',
position: 'relative',
color: 'red',
'border-top-left-radius' : '2.5em'
});
Returns: TagBuilder<HTMLElement>
Set the width of the element
Returns: TagBuilder<HTMLElement>
Sets up a function that will be called whenever the specified event is delivered to the target
Returns: TagBuilder<HTMLElement>
Clone the current tag builder. This deep clones the node it respectively manages
Note: this uses the same HTMLElement.cloneNode() method native to browsers, therefor, things like id's and individual configurations for a given node will be duplicated as-is
Returns: HTMLElement
The node the current builder manages as an HTMLElement
Returns: HTMLElement
This is the required build method when in `headless` mode. It returns the outerHTML of an HTMLElement when in `document` mode, otherwise the HTML markup when in `headless` mode
Returns: TagBuilder<HTMLElement>
Provides a hint for generating a keyboard shortcut for the current element
Returns: TagBuilder<HTMLElement>
Provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. Used primarily on <input> elements, but is usable on any element while in contenteditable mode
Returns: TagBuilder<HTMLElement>
Coerce an element into being editable by the user. The browser modifies this tag to allow editing
Returns: TagBuilder<HTMLElement>
Directionality of the element's text
Returns: TagBuilder<HTMLElement>
Coerces an element into being draggable. Use the Drag and Drop API
Returns: TagBuilder<HTMLElement>
Coerces an element to indicate that it is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown
Returns: TagBuilder<HTMLElement>
Coerce the element to be checked for spelling errors
Returns: TagBuilder<HTMLElement>
Sets the text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip
Returns: TagBuilder<HTMLElement>
Represents the "rendered" text content of a node and its descendants
`innerText` is easily confused with Node.textContent, but there are important differences between the two. Basically, `innerText` is aware of the rendered appearance of text, while `textContent` is not
Returns: TagBuilder<HTMLElement>
Controls whether and how text input is automatically capitalized as it is entered/edited by the user
Returns: TagBuilder<HTMLElement>
Set the css caret-color property of the element
Returns: TagBuilder<HTMLElement>
Transform text to a specfic case using the CSS text-transform property
Returns: TagBuilder<HTMLElement>
The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a `<table>`
Returns: TagBuilder<HTMLElement>
Set the element to explicitly be for screen readers only, using the WCAG Standards
This will automatically add the following styles inline to the element:
element {
border: 0,
clip: rect(0 0 0 0),
height: 1px,
margin: -1px,
overflow: hidden,
padding: 0,
position: absolute,
width: 1px
}
Returns: TagBuilder<HTMLElement>
Parse an html string of HTML elements and cast that element to a TagBuilder
Please note, this only considers HTMLElement.nodeType of 1. Meaning this ignores comments, and document fragments and text nodes etc
This method honors attributes in the string
TabBuilder Subclasses
In order to help facilitate a semantic HTML experience and self-documenting code, there are numerous TagBuilder subclasses at your disposal to quickly create specific elements but also semantic-driven elements . These subclasses have unique methods respective to their purpose, for example, the TableBuilder has an addRow()
method to quickly add a <tr> with data and the ListBuilder has an addSublist()
method to add a sublist to a <ul> or <ol>, the semantic proper way by wrapping the sublist in a <li>
This element builder is used to create a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address
Documentation
constructor( href, target?, id? )
Returns: AnchorBuilder<HTMLAnchorElement>
hreflang( lang )
Returns: AnchorBuilder<HTMLAnchorElement>
Hints at the human language of the linked URL. No built-in functionality
mimeType( value )
Returns: AnchorBuilder<HTMLAnchorElement>
Hints at the linked URL’s format with a MIME type
ping( urls )
Returns: AnchorBuilder<HTMLAnchorElement>
A list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking
rel( value )
Returns: AnchorBuilder<HTMLAnchorElement>
The relationship of the linked URL as space-separated link types
This element builder is used to create an area inside an image map that has predefined clickable areas. An image map allows geometric areas on an image to be associated with hypertext link
Documentation
constructor( coords, shape?, id? )
Returns: AreaBuilder<HTMLAreaElement>
href( url, alt )
Returns: AreaBuilder<HTMLAreaElement>
The hyperlink target for the area. Its value is a valid URL. This attribute may be omitted; if so, the <area> element does not represent a hyperlink
hreflang( lang )
Returns: AreaBuilder<HTMLAreaElement>
Hints at the human language of the linked URL. No built-in functionality
ping( urls )
Returns: AreaBuilder<HTMLAreaElement>
A list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking
rel( value )
Returns: AreaBuilder<HTMLAreaElement>
The relationship of the linked URL as space-separated link types
target( value )
Returns: AreaBuilder<HTMLAreaElement>
A keyword or author-defined name of the browsing context to display the linked resource
This element builder is used to create embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream
Documentation
constructor( src, id? )
Returns: AudioBuilder<HTMLAudioElement>
addFallbackSrc( src, type )
Returns: AudioBuilder<HTMLAudioElement>
Add a source for browsers that don't support main src
Provide url and mimetype of url content
loop()
Returns: AudioBuilder<HTMLAudioElement>
The audio player will automatically seek back to the start upon reaching the end of the audio
muted()
Returns: AudioBuilder<HTMLAudioElement>
Mutes the element
noControls()
Returns: AudioBuilder<HTMLAudioElement>
Indicates that the browser will not offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback
onNotSupported( html )
Returns: AudioBuilder<HTMLAudioElement>
HTML or text to be displayed for browsers that do not support this element
preload( value )
Returns: AudioBuilder<HTMLAudioElement>
Provide a hint to the browser about what the author thinks will lead to the best user experience
track( src, kind, isDefault?, srclang?, label? )
Returns: AudioBuilder<HTMLAudioElement>
Specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks
-
Arguments
src: string
kind: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'
isDefault?: boolean
srclang?: string
label?: string
-
Usage
new AudioBuilder('www.example.com/audio.mp3').track('/media/examples/source.vtt', 'captions', true, 'en');
This element builder is used to create an element that indicates the enclosed text is an extended quotation. Usually, this is rendered visually by indentation. A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the `<cite>` element
Documentation
constructor( cite?, id? )
Returns: BlockquoteBuilder<HTMLQuoteElement>
This element builder is used to create an element that indicates the enclosed text is an extended quotation. Usually, this is rendered visually by indentation. A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the `<cite>` element
This element builder is used to create a check box allowing single values to be selected/deselected
Documentation
constructor( isIndeterminate?, id? )
Returns: CheckboxInputBuilder<HTMLInputElement>
checked()
Returns: CheckboxInputBuilder<HTMLInputElement>
Indicated that the radio button is checked
This element builder is used to create a group of columns within a table
Documentation
constructor( id? )
Returns: ColGroupBuilder<HTMLElement>
-
Arguments
-
Usage
new ColGroupBuilder();
- See also:
addCol( span?, ...aClass )
Returns: ColGroupBuilder<HTMLElement>
This element builder is used to create an element that links a given piece of content with a machine-readable translation. If the content is time- or date-related, the <time> element must be used
Documentation
constructor( value, id? )
Returns: DataBuilder<HTMLDataElement>
-
Arguments
value: string
id?: string
-
Usage
new DataBuilder();
- See also:
This element builder is used to create an element that contains a set of `<option>` elements that represent the permissible or recommended options available to choose from within other controls
Documentation
constructor( id )
Returns: DataListBuilder<HTMLDataListElement>
id is required
-
Arguments
-
Usage
new DataListBuilder();
- See also:
addOption( content, value, classes? )
Returns: DataListBuilder<HTMLDataListElement>
Add an `<option>` element to the datalist
addOptions( ...option )
Returns: DataListBuilder<HTMLDataListElement>
This element builder is used to create a control for entering a date (year, month, and day, with no time). Opens a date picker or numeric wheels for year, month, day when active in supporting browsers
Documentation
constructor( value?, id? )
Returns: DateInputBuilder<HTMLInputElement>
This element builder is used to create a control for entering a date and time, with no time zone. Opens a date picker or numeric wheels for date- and time-components when active in supporting browsers
Documentation
constructor( value?, id? )
Returns: DateTimeLocalInputBuilder<HTMLInputElement>
This element builder is used to create a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label must be provided using the `<summary>` element
Documentation
constructor( summary?, open?, id? )
Returns: DetailsBuilder<HTMLDetailsElement>
-
Arguments
summary?: string
open?: boolean
id?: string
-
Usage
new DetailsBuilder();
- See also:
This element builder is used to create an element that represents a description list. The element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs)
Documentation
constructor( wrapDtDdGroupsInDiv?, groupsDivClasses?, id? )
Returns: DLBuilder<HTMLDListElement>
Semantic HTML allows for premitted content to be one or more `<div>` elements if you don't want the `<dt>` and `<dd>` elements to be direct descendants
-
Arguments
wrapDtDdGroupsInDiv?: boolean
groupsDivClasses?: classes
id?: string
-
Usage
new DLBuilder();
- See also:
addTerm( term, ...dd(string | TagBuilder) )
Returns: DLBuilder<HTMLDListElement>
-
Arguments
term: string
...dd(string | TagBuilder)[]
-
Usage
new DLBuilder();
An extended class of AreaBuilder that creates an `<area>` tag specifically meant to act as a clickable download link
Documentation
constructor( filename, coords, shape?, id? )
Returns: DownloadAreaBuilder<HTMLAreaElement>
An extended class of AnchorBuilder that creates an `<a>` tag specifically meant to act as a clickable download link
Documentation
constructor( href, filename, id? )
Returns: DownloadLinkBuilder<HTMLAnchorElement>
This element builder is used to create a field for editing an email address. Looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards
Documentation
constructor( id? )
Returns: EmailInputBuilder<HTMLInputElement>
-
Arguments
-
Usage
new EmailInputBuilder();
multiple()
Returns: EmailInputBuilder<HTMLInputElement>
This element builder is used to create an element that embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in
Documentation
constructor( src, type, id? )
Returns: EmbedBuilder<HTMLInputElement>
Provide the src url and MIME type
-
Arguments
src: string
type: string
id?: string
-
Usage
new EmbedBuilder();
- See also:
This element builder is used to group several controls as well as labels (`<label>`) within a web form
Documentation
constructor( legend?, id? )
Returns: FieldsetBuilder<HTMLFieldSetElement>
-
Arguments
legend?: string
id?: string
-
Usage
new FieldsetBuilder();
- See also:
This element builder is used to create an element that represents self-contained content, potentially with an optional caption
Documentation
constructor( caption?, captionPlacement?, id? )
Returns: FigureBuilder<HTMLElement>
-
Arguments
caption?: html
captionPlacement?: 'top' | 'bottom'
id?: string
-
Usage
new FigureBuilder();
- See also:
This element builder is used to create a control that lets the user select a file. Use the accept attribute to define the types of files that the control can select
Documentation
constructor( accept?, id? )
Returns: FileInputBuilder<HTMLInputElement>
-
Arguments
accept?: string
id?: string
-
Usage
new FileInputBuilder();
- See also:
This element builder is used to create a document section containing interactive controls for submitting information
Documentation
constructor( actionUrl, method?, id? )
Returns: FormBuilder<HTMLFormElement>
acceptCharset( ...value )
Returns: FormBuilder<HTMLFormElement>
enctype( value )
Returns: FormBuilder<HTMLFormElement>
rel( value )
Returns: FormBuilder<HTMLFormElement>
The relationship of the linked URL as space-separated link types
target( value )
Returns: FormBuilder<HTMLFormElement>
Indicates where to display the response after submitting the form
noValidate()
Returns: FormBuilder<HTMLFormElement>
Indicates that the form shouldn't be validated when submitted
This element builder is used to create a inline frame element (`<iframe>`) that represents a nested browsing context, embedding another HTML page into the current one
Documentation
constructor( src, id? )
Returns: IframeBuilder<HTMLIframeElement>
The URL of the page to embed. Use a value of `about:blank` to embed an empty page that conforms to the same-origin policy. Also note that programmatically removing an `<iframe>`'s src attribute (e.g. via Element.removeAttribute()) causes `about:blank` to be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS
allow( value )
Returns: IframeBuilder<HTMLIframeElement>
Specifies a feature policy for the `<iframe>`. The policy defines what features are available to the `<iframe>` based on the origin of the request (e.g. access to the microphone, camera, battery, web-share API, etc.)
referrerPolicy( value )
Returns: IframeBuilder<HTMLIframeElement>
sandbox( value )
Returns: IframeBuilder<HTMLIframeElement>
Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions
srcdoc( value )
Returns: IframeBuilder<HTMLIframeElement>
Inline HTML to embed, overriding the src attribute. If a browser does not support the srcdoc attribute, it will fall back to the URL in the src attribute
This element builder is used to create an element that embeds an image into the document
Documentation
constructor( src, alt, id? )
Returns: ImageBuilder<HTMLImageElement>
decoding( value )
Returns: ImageBuilder<HTMLImageElement>
sizes( value )
Returns: ImageBuilder<HTMLImageElement>
srcset( value )
Returns: ImageBuilder<HTMLImageElement>
This element builder is used to create a graphical submit button. Displays an image defined by the src attribute. The alt attribute displays if the image src is missing.
Documentation
constructor( src, alt, id? )
Returns: ImageInputBuilder<HTMLInputElement>
formAction( url )
Returns: ImageInputBuilder<HTMLInputElement>
formEnctype( enctype )
Returns: ImageInputBuilder<HTMLInputElement>
formMethod( method )
Returns: ImageInputBuilder<HTMLInputElement>
This element builder is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent
Documentation
constructor( type?, id? )
Returns: InputBuilder<HTMLInputElement>
Provide input type (i.e., text, sumbit, button, email etc)
-
Arguments
type?: string = 'text'
id?: string
-
Usage
new InputBuilder();
autocomplete( value )
Returns: InputBuilder<HTMLInputElement>
Hint for form autofill feature
autofocus()
Returns: InputBuilder<HTMLInputElement>
Automatically focus the form control when the page is loaded
datalist( id )
Returns: InputBuilder<HTMLInputElement>
The value given should be the id of a `<datalist>` element located in the same document which provides predefined values to suggest to the user for this input
disabled()
Returns: InputBuilder<HTMLInputElement>
Disables the control
name( value )
Returns: InputBuilder<HTMLInputElement>
Name of the form control. Submitted with the form as part of a name/value pair
onInvalid( value )
Returns: InputBuilder<HTMLInputElement>
Text that will appear under on this form control when it is resolved to invalid. This set's the validity message
placeholder( value )
Returns: InputBuilder<HTMLInputElement>
Text that appears in the form control when it has no value set
readonly()
Returns: InputBuilder<HTMLInputElement>
Specify that the control is readonly
required()
Returns: InputBuilder<HTMLInputElement>
A value is required or must be check for the form to be submittable
value( value )
Returns: InputBuilder<HTMLInputElement>
value The initial value of the control
This element builder is used to create an element with a list of items rendered in list format
Documentation
constructor( isOrdered?, style?, id? )
Returns: ListBuilder<HTMLULListElement>
Identify if the list should be ordered <ol></ol> or unordered
The list-style of the given list
-
Arguments
isOrdered?: boolean = false
style?: string
id?: string
-
Usage
new ListBuilder();
addItem( item )
Returns: ListBuilder<HTMLULListElement>
addItems( items )
Returns: ListBuilder<HTMLULListElement>
addSublist( listBuilder )
Returns: ListBuilder<HTMLULListElement>
Add's a sublist list `<ul>` or `<ol>` with proper HTML markup by automatically adding it to a `<li>`. This is semantic HTML as well as proper HTML markup
This element builder is used to create an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter
Documentation
constructor( html )
Returns: ListItemBuilder<HTMLLIElement>
This element builder is used to create an element that represents either a scalar value within a known range or a fractional value
Documentation
constructor( id? )
Returns: MeterBuilder<HTMLMeterElement>
-
Arguments
-
Usage
new MeterBuilder();
- See also:
min( value )
Returns: MeterBuilder<HTMLMeterElement>
The lower numeric bound of the measured range. This must be less than the maximum value (max attribute), if specified. If unspecified, the minimum value is 0
max( value )
Returns: MeterBuilder<HTMLMeterElement>
The upper numeric bound of the measured range. This must be greater than the minimum value (min attribute), if specified. If unspecified, the maximum value is 1
minmax( min, max )
Returns: MeterBuilder<HTMLMeterElement>
low( value )
Returns: MeterBuilder<HTMLMeterElement>
The upper numeric bound of the low end of the measured range. This must be greater than the minimum value (min attribute), and it also must be less than the high value and maximum value (high attribute and max attribute, respectively), if any are specified. If unspecified, or if less than the minimum value, the low value is equal to the minimum value
high( value )
Returns: MeterBuilder<HTMLMeterElement>
lowhigh( low, high )
Returns: MeterBuilder<HTMLMeterElement>
The lower numeric bound of the high end of the measured range. This must be less than the maximum value (max attribute), and it also must be greater than the low value and minimum value (low attribute and min attribute, respectively), if any are specified. If unspecified, or if greater than the maximum value, the high value is equal to the maximum value
optimum( value )
Returns: MeterBuilder<HTMLMeterElement>
This attribute indicates the optimal numeric value. It must be within the range (as defined by the min attribute and max attribute). When used with the low attribute and high attribute, it gives an indication where along the range is considered preferable. For example, if it is between the min attribute and the low attribute, then the lower range is considered preferred. The browser may color the meter's bar differently depending on whether the value is less than or equal to the optimum value
This element builder is used to create a control for entering a month and year, with no time zone
Documentation
constructor( value?, id? )
Returns: MonthInputBuilder<HTMLInputElement>
-
Arguments
value?: string
id?: string
-
Usage
new MonthInputBuilder();
- See also:
This element builder is used to create a control for entering a number. Displays a spinner and adds default validation when supported. Displays a numeric keypad in some devices with dynamic keypads
Documentation
constructor( value?, id? )
Returns: NumberInputBuilder<HTMLInputElement>
min( value )
Returns: NumberInputBuilder<HTMLInputElement>
The minimum value to accept for this control
max( value )
Returns: NumberInputBuilder<HTMLInputElement>
The maximum value to accept for this control
step( interval )
Returns: NumberInputBuilder<HTMLInputElement>
A stepping interval to use when using up and down arrows to adjust the value, as well as for validation
This element builder is used to create an item contained in a `<select>`, an `<optgroup>`, or a `<datalist>` element. As such, `<option>` can represent menu items in popups and other lists of items in an HTML document
Documentation
constructor( content, value?, id? )
Returns: OptionBuilder<HTMLOptionElement>
This element builder is used to create a single-line text field whose value is obscured. Will alert user if site is not secure
Documentation
constructor( id? )
Returns: PasswordInputBuilder<HTMLInputElement>
This element builder is used to create a `<picture>` element that contains zero or more `<source>` elements and one `<img>` element to offer alternative versions of an image for different display/device scenarios
The browser will consider each child `<source>` element and choose the best match among them. If no matches are found—or the browser doesn't support the `<picture>` element—the URL of the `<img>` element's src attribute is selected. The selected image is then presented in the space occupied by the `<img>` element
Documentation
constructor( imgBuilder, id? )
Returns: PictureBuilder<HTMLPictureElement>
-
Arguments
imgBuilder: ImageBuilder
id?: string
-
Usage
new PictureBuilder();
- See also:
source( ...source )
Returns: PictureBuilder<HTMLPictureElement>
Add an alternate source (`<source>`) tag via SourceBuilders
This element builder is used to create an indicator showing the completion progress of a task, typically displayed as a progress bar
Documentation
constructor( value, id? )
Returns: ProgressBuilder<HTMLProgressElement>
-
Arguments
value: number
id?: string
-
Usage
new ProgressBuilder(50);
- See also:
max( value )
Returns: ProgressBuilder<HTMLProgressElement>
A radio button, allowing a single value to be selected out of multiple choices with the same name value
Documentation
constructor( checked?, id? )
Returns: RadioInputBuilder<HTMLInputElement>
-
Arguments
checked?: boolean = false
id?: string
-
Usage
new RadioInputBuilder();
- See also:
This element builder is used to create a control for entering a number whose exact value is not important. Displays as a range widget defaulting to the middle value. Used in conjunction min and max to define the range of acceptable values
Documentation
constructor( value?, id? )
Returns: RangeInputBuilder<HTMLInputElement>
-
Arguments
value?: string
id?: string
-
Usage
new RangeInputBuilder();
- See also:
This element builder is used to create an element that is used to embed executable code or data; this is typically used to embed or refer to JavaScript code
Documentation
constructor( id? )
Returns: ScriptBuilder<HTMLScriptElement>
-
Arguments
-
Usage
new ScriptBuilder();
- See also:
async()
Returns: ScriptBuilder<HTMLScriptElement>
crossOrigin( value )
Returns: ScriptBuilder<HTMLScriptElement>
defer()
Returns: ScriptBuilder<HTMLScriptElement>
integrity( value )
Returns: ScriptBuilder<HTMLScriptElement>
This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation
noModule()
Returns: ScriptBuilder<HTMLScriptElement>
Indicate that the script should not be executed in browsers that support ES2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code
nonce( value )
Returns: ScriptBuilder<HTMLScriptElement>
A cryptographic nonce (number used once) to whitelist scripts in a script-src Content-Security-Policy. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial
referrerPolicy( value )
Returns: ScriptBuilder<HTMLScriptElement>
src( value )
Returns: ScriptBuilder<HTMLScriptElement>
type( value )
Returns: ScriptBuilder<HTMLScriptElement>
This element builder is used to create a single-line text field for entering search strings. Line-breaks are automatically removed from the input value. May include a delete icon in supporting browsers that can be used to clear the field. Displays a search icon instead of enter key on some devices with dynamic keypads
Documentation
constructor( id? )
Returns: SearchInputBuilder<HTMLInputElement>
This element builder is used to create an element that represents a control that provides a menu of options
Documentation
constructor( instructionMessage?, id? )
Returns: SelectBuilder<HTMLSelectElement>
Instruction message, if provided, will be the first option in the element that is usually used as a placeholder. It is automatically given an attribute `value` of `""` and disabled for selection
-
Arguments
instructionMessage?: string
id?: string
-
Usage
new SelectBuilder();
- See also:
addOptionGroup( label, ...option )
Returns: SelectBuilder<HTMLSelectElement>
Create an `<optgroup>` container with provided options
addOption( content, value, classes )
Returns: SelectBuilder<HTMLSelectElement>
addOptions( options )
Returns: SelectBuilder<HTMLSelectElement>
autocomplete( value )
Returns: SelectBuilder<HTMLSelectElement>
Hint for form autofill feature
autofocus()
Returns: SelectBuilder<HTMLSelectElement>
Automatically focus the form control when the page is loaded
disabled()
Returns: SelectBuilder<HTMLSelectElement>
Disables the control
multiple()
Returns: SelectBuilder<HTMLSelectElement>
Indicates that multiple options can be selected in the list
name( value )
Returns: SelectBuilder<HTMLSelectElement>
Name of the form control. Submitted with the form as part of a name/value pair
onInvalid( value )
Returns: SelectBuilder<HTMLSelectElement>
Text that will appear under on this form control when it is resolved to invalid. This set's the validity message
required()
Returns: SelectBuilder<HTMLSelectElement>
A value is required or must be check for the form to be submittable
size( value )
Returns: SelectBuilder<HTMLSelectElement>
If the control is presented as a scrolling list box (multiple) this attribute indicates how many rows should be displayed at a time
This element builder is used to create an element - part of the Web Components technology suite - that is a placeholder inside a web component that you can fill with your own markup, which lets you create separate DOM trees and present them together
Documentation
constructor( name, content, id? )
Returns: SlotBuilder<HTMLSlotElement>
This element builder is used to create an element that specifies multiple media resources for the `<picture>`, the `<audio>` element, or the `<video>` element. It is an empty element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats
Documentation
constructor( src, type, id? )
Returns: SourceBuilder<HTMLSourceElement>
media( value )
Returns: SourceBuilder<HTMLSourceElement>
Media query of the resource's intended media; this should be used only in a `<picture>` element
sizes( value )
Returns: SourceBuilder<HTMLSourceElement>
srcset( value )
Returns: SourceBuilder<HTMLSourceElement>
This element builder is used to create a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. `<span>` is very much like a <div> element, but `<div>` is a block-level element whereas a `<span>` is an inline element
Documentation
constructor( style? )
Returns: SpanBuilder<HTMLSpanElement>
bold()
Returns: SpanBuilder<HTMLSpanElement>
bolder()
Returns: SpanBuilder<HTMLSpanElement>
italic()
Returns: SpanBuilder<HTMLSpanElement>
lighter()
Returns: SpanBuilder<HTMLSpanElement>
underline()
Returns: SpanBuilder<HTMLSpanElement>
strikethrough()
Returns: SpanBuilder<HTMLSpanElement>
color( value )
Returns: SpanBuilder<HTMLSpanElement>
This element builder is used to create tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data
Documentation
constructor( caption?, id? )
Returns: TableBuilder<HTMLTableElement>
-
Arguments
caption?: string
id?: string
-
Usage
new TableBuilder();
- See also:
addHeader( ...th )
Returns: TableBuilder<HTMLTableElement>
addRow( ...td )
Returns: TableBuilder<HTMLTableElement>
HTML or text values that will be rendered as `<td>` content, automatically added to a `<tr>`
colgroup( builder )
Returns: TableBuilder<HTMLTableElement>
collapse()
Returns: TableBuilder<HTMLTableElement>
Specify that the table should use `border-collapse: collapse`
setHeaders( ...header )
Returns: TableBuilder<HTMLTableElement>
setRows( ...row )
Returns: TableBuilder<HTMLTableElement>
-
Arguments
-
Usage
new TableBuilder().setRows(['A1', 'A2', 'A3'], ['B1', 'B2', 'B3']);
This element builder is used to create a control for entering a telephone number. Displays a telephone keypad in some devices with dynamic keypads
Documentation
constructor( id? )
Returns: TelInputBuilder<HTMLInputElement>
-
Arguments
-
Usage
new TelInputBuilder();
- See also:
This element builder is used to create a mechanism for holding HTML that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using JavaScript
Think of a template as a content fragment that is being stored for subsequent use in the document. While the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however
Documentation
constructor( id )
Returns: TemplateBuilder<HTMLInputElement>
-
Arguments
-
Usage
new TemplateBuilder();
- See also:
addStylesToRoot( cssText )
Returns: TemplateBuilder<HTMLInputElement>
addSlots( ...slot )
Returns: TemplateBuilder<HTMLInputElement>
This element builder is used to create an element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form
Documentation
constructor( rows?, cols?, id? )
Returns: TextAreaBuilder<HTMLTextAreaElement>
-
Arguments
rows?: number
cols?: number
id?: string
-
Usage
new TextAreaBuilder();
- See also:
autocomplete( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
Hint for form autofill feature
autofocus()
Returns: TextAreaBuilder<HTMLTextAreaElement>
Automatically focus the form control when the page is loaded
disabled()
Returns: TextAreaBuilder<HTMLTextAreaElement>
Disables the control
maxLength()
Returns: TextAreaBuilder<HTMLTextAreaElement>
The maximum number of characters (UTF-16 code units) required that the user should enter
minLength()
Returns: TextAreaBuilder<HTMLTextAreaElement>
The minimum number of characters (UTF-16 code units) required that the user should enter
name( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
Name of the form control. Submitted with the form as part of a name/value pair
onInvalid( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
Text that will appear under on this form control when it is resolved to invalid. This set's the validity message
placeholder( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
Text that appears in the form control when it has no value set
readonly()
Returns: TextAreaBuilder<HTMLTextAreaElement>
Specify that the control is readonly
required()
Returns: TextAreaBuilder<HTMLTextAreaElement>
A value is required or must be check for the form to be submittable
value( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
value The initial value of the control
wrap( value )
Returns: TextAreaBuilder<HTMLTextAreaElement>
Indicates how the control wraps text
This element builder is used to create a single-line text field. Line-breaks are automatically removed from the input value
Documentation
constructor( id? )
Returns: TextInputBuilder<HTMLInputElement>
-
Arguments
-
Usage
new TextInputBuilder();
- See also:
maxLength( value )
Returns: TextInputBuilder<HTMLInputElement>
The maximum number of characters the input should accept
minLength( value )
Returns: TextInputBuilder<HTMLInputElement>
The minimum number of characters the input should accept
pattern( value )
Returns: TextInputBuilder<HTMLInputElement>
size( value )
Returns: TextInputBuilder<HTMLInputElement>
This element builder is used to create a control for entering a time value with no time zone
Documentation
constructor( value?, id? )
Returns: TimeInputBuilder<HTMLInputElement>
-
Arguments
value?: string
id?: string
-
Usage
new TimeInputBuilder();
- See also:
This element builder is used to create a field for entering a URL. Looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards
Documentation
constructor( id? )
Returns: UrlInputBuilder<HTMLInputElement>
-
Arguments
-
Usage
new UrlInputBuilder();
- See also:
This element builder is used to create an element (`<video>`) that embeds a media player which supports video playback into the document
Documentation
constructor( src, type, id? )
Returns: VideoBuilder<HTMLVideoElement>
addFallbackSrc( src, type )
Returns: VideoBuilder<HTMLVideoElement>
Add a source for browsers that don't support main src
Provide url and mimetype of url content
loop()
Returns: VideoBuilder<HTMLVideoElement>
The audio player will automatically seek back to the start upon reaching the end of the audio
muted()
Returns: VideoBuilder<HTMLVideoElement>
Mutes the element
noControls()
Returns: VideoBuilder<HTMLVideoElement>
Indicates that the browser will not offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback
onNotSupported( html )
Returns: VideoBuilder<HTMLVideoElement>
HTML or text to be displayed for browsers that do not support this element
poster( url )
Returns: VideoBuilder<HTMLVideoElement>
A URL for an image to be shown while the video is downloading. If this attribute isn't specified, nothing is displayed until the first frame is available, then the first frame is shown as the poster frame
preload( value )
Returns: VideoBuilder<HTMLVideoElement>
Provide a hint to the browser about what the author thinks will lead to the best user experience
track( src, kind, isDefault?, srclang?, label? )
Returns: VideoBuilder<HTMLVideoElement>
Specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks
-
Arguments
src: string
kind: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'
isDefault?: boolean
srclang?: string
label?: string
-
Usage
new VideoBuilder('www.example.com/video.mp4', 'video/mp4').track('/media/examples/source.vtt', 'captions', true, 'en');
This element builder is used to create a control for entering a date consisting of a week-year number and a week number with no time zone
Documentation
constructor( value?, id? )
Returns: WeekInputBuilder<HTMLInputElement>
-
Arguments
value?: string
id?: string
-
Usage
new WeekInputBuilder();
- See also: