mellie/attr
Element creation functions scraped from https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes This list automatically excludes any elements or attributes that are deprecated
Values
pub fn accept(value: a) -> #(String, a)
List of types the server accepts, typically a file type.
pub fn accept_charset(value: a) -> #(String, a)
The character set, which if provided must be “UTF-8” .
pub fn accesskey(value: a) -> #(String, a)
Keyboard shortcut to activate or add focus to the element.
pub fn action(value: a) -> #(String, a)
The URI of a program that processes the information submitted via the form.
pub fn alpha(value: a) -> #(String, a)
Allow the user to select a color’s opacity on a type=“color” input.
pub fn as_(value: a) -> #(String, a)
Specifies the type of content being loaded by the link.
pub fn autocapitalize(value: a) -> #(String, a)
Sets whether input is automatically capitalized when entered by user
pub fn autocomplete(value: a) -> #(String, a)
Indicates whether controls in this form can by default have their values automatically completed by the browser.
pub fn autoplay(value: a) -> #(String, a)
The audio or video should play as soon as possible.
pub fn background(value: a) -> #(String, a)
Specifies the URL of an image file. Note: Although browsers and email clients may still support this attribute, it is obsolete. Use CSS background-image instead.
pub fn bgcolor(value: a) -> #(String, a)
Background color of the element. Note: This is a legacy attribute. Please use the CSS background-color property instead.
pub fn border(value: a) -> #(String, a)
The border width. Note: This is a legacy attribute. Please use the CSS border property instead.
pub fn capture(value: a) -> #(String, a)
From the Media Capture specification , specifies a new file can be captured.
pub fn charset(value: a) -> #(String, a)
Declares the character encoding of the page or script.
pub fn checked(value: a) -> #(String, a)
Indicates whether the element should be checked on page load.
pub fn cite(value: a) -> #(String, a)
Contains a URI which points to the source of the quote or change.
pub fn class(value: a) -> #(String, a)
Often used with CSS to style elements with common properties.
pub fn color(value: a) -> #(String, a)
This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead.
pub fn colorspace(value: a) -> #(String, a)
Defines the color space that is used by a type=“color” input.
pub fn colspan(value: a) -> #(String, a)
The colspan attribute defines the number of columns a cell should span.
pub fn content(value: a) -> #(String, a)
A value associated with http-equiv or name depending on the context.
pub fn contenteditable(value: a) -> #(String, a)
Indicates whether the element’s content is editable.
pub fn controls(value: a) -> #(String, a)
Indicates whether the browser should show playback controls to the user.
pub fn coords(value: a) -> #(String, a)
A set of values specifying the coordinates of the hot-spot region.
pub fn crossorigin(value: a) -> #(String, a)
How the element handles cross-origin requests
pub fn csp(value: a) -> #(String, a)
Specifies the Content Security Policy that an embedded document must agree to enforce upon itself.
pub fn datetime(value: a) -> #(String, a)
Indicates the date and time associated with the element.
pub fn decoding(value: a) -> #(String, a)
Indicates the preferred method to decode the image.
pub fn default(value: a) -> #(String, a)
Indicates that the track should be enabled unless the user’s preferences indicate something different.
pub fn defer(value: a) -> #(String, a)
Indicates that the script should be executed after the page has been parsed.
pub fn dir(value: a) -> #(String, a)
Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
pub fn disabled(value: a) -> #(String, a)
Indicates whether the user can interact with the element.
pub fn download(value: a) -> #(String, a)
Indicates that the hyperlink is to be used for downloading a resource.
pub fn draggable(value: a) -> #(String, a)
Defines whether the element can be dragged.
pub fn elementtiming(value: a) -> #(String, a)
Indicates that an element is flagged for tracking by PerformanceObserver objects using the “element” type. For more details, see the PerformanceElementTiming interface.
pub fn enctype(value: a) -> #(String, a)
Defines the content type of the form data when the method is POST.
pub fn enterkeyhint(value: a) -> #(String, a)
The enterkeyhint specifies what action label (or icon) to present for the enter key on virtual keyboards. The attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute).
pub fn fetchpriority(value: a) -> #(String, a)
Signals that fetching a particular image early in the loading process has more or less impact on user experience than a browser can reasonably infer when assigning an internal priority.
pub fn formaction(value: a) -> #(String, a)
Indicates the action of the element, overriding the action defined in the form .
pub fn formenctype(value: a) -> #(String, a)
If the button/input is a submit button (e.g., type=“submit” ), this attribute sets the encoding type to use during form submission. If this attribute is specified, it overrides the enctype attribute of the button’s form owner.
pub fn formmethod(value: a) -> #(String, a)
If the button/input is a submit button (e.g., type=“submit” ), this attribute sets the submission method to use during form submission ( GET , POST , etc.). If this attribute is specified, it overrides the method attribute of the button’s form owner.
pub fn formnovalidate(value: a) -> #(String, a)
If the button/input is a submit button (e.g., type=“submit” ), this boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the novalidate attribute of the button’s form owner.
pub fn formtarget(value: a) -> #(String, a)
If the button/input is a submit button (e.g., type=“submit” ), this attribute specifies the browsing context (for example, tab, window, or inline frame) in which to display the response that is received after submitting the form. If this attribute is specified, it overrides the target attribute of the button’s form owner.
pub fn headers(value: a) -> #(String, a)
IDs of the th elements which applies to this element.
pub fn height(value: a) -> #(String, a)
Specifies the height of elements listed here. For all other elements, use the CSS height property. Note: In some instances, such as div , this is a legacy attribute, in which case the CSS height property should be used instead.
pub fn hidden(value: a) -> #(String, a)
Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
pub fn hreflang(value: a) -> #(String, a)
Specifies the language of the linked resource.
pub fn id(value: a) -> #(String, a)
Often used with CSS to style a specific element. The value of this attribute must be unique.
pub fn inputmode(value: a) -> #(String, a)
Provides a hint as to the type of data that might be entered by the user while editing the element or its contents. The attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute).
pub fn integrity(value: a) -> #(String, a)
This attribute contains one or more hashes of the resource, and is used to ensure that the content of the resource is what the developer expects it to be, and has not been replaced with a malicious copy in a supply chain attack . See Subresource Integrity .
pub fn ismap(value: a) -> #(String, a)
Indicates that the image is part of a server-side image map.
pub fn language(value: a) -> #(String, a)
Defines the script language used in the element.
pub fn list(value: a) -> #(String, a)
Identifies a list of pre-defined options to suggest to the user.
pub fn loading(value: a) -> #(String, a)
Indicates if the element should be loaded lazily ( loading=“lazy” ) or loaded immediately ( loading=“eager” ).
pub fn loop(value: a) -> #(String, a)
Indicates whether the media should start playing from the start when it’s finished.
pub fn maxlength(value: a) -> #(String, a)
Defines the maximum number of characters allowed in the element.
pub fn media(value: a) -> #(String, a)
Specifies a hint of the media for which the linked resource was designed.
pub fn method(value: a) -> #(String, a)
Defines which HTTP method to use when submitting the form. Can be GET (default) or POST .
pub fn minlength(value: a) -> #(String, a)
Defines the minimum number of characters allowed in the element.
pub fn multiple(value: a) -> #(String, a)
Indicates whether multiple values can be entered in an input of the type email or file .
pub fn muted(value: a) -> #(String, a)
Indicates whether the audio will be initially silenced on page load.
pub fn name(value: a) -> #(String, a)
Name of the element. For example used by the server to identify the fields in form submits.
pub fn novalidate(value: a) -> #(String, a)
This attribute indicates that the form shouldn’t be validated when submitted.
pub fn open(value: a) -> #(String, a)
Indicates whether the contents are currently visible (in the case of a details element) or whether the dialog is active and can be interacted with (in the case of a dialog element).
pub fn pattern(value: a) -> #(String, a)
Defines a regular expression which the element’s value will be validated against.
pub fn ping(value: a) -> #(String, a)
The ping attribute specifies a space-separated list of URLs to be notified if a user follows the hyperlink.
pub fn placeholder(value: a) -> #(String, a)
Provides a hint to the user of what can be entered in the field.
pub fn playsinline(value: a) -> #(String, a)
A Boolean attribute indicating that the video is to be played “inline”; that is, within the element’s playback area. Note that the absence of this attribute does not imply that the video will always be played in fullscreen.
pub fn poster(value: a) -> #(String, a)
A URL indicating a poster frame to show until the user plays or seeks.
pub fn preload(value: a) -> #(String, a)
Indicates whether the whole resource, parts of it or nothing should be preloaded.
pub fn referrerpolicy(value: a) -> #(String, a)
Specifies which referrer is sent when fetching the resource.
pub fn rel(value: a) -> #(String, a)
Specifies the relationship of the target object to the link object.
pub fn required(value: a) -> #(String, a)
Indicates whether this element is required to fill out or not.
pub fn reversed(value: a) -> #(String, a)
Indicates whether the list should be displayed in a descending order instead of an ascending order.
pub fn role(value: a) -> #(String, a)
Defines an explicit role for an element for use by assistive technologies.
pub fn rowspan(value: a) -> #(String, a)
Defines the number of rows a table cell should span over.
pub fn sandbox(value: a) -> #(String, a)
Stops a document loaded in an iframe from using certain features (such as submitting forms or opening new windows).
pub fn scope(value: a) -> #(String, a)
Defines the cells that the header test (defined in the th element) relates to.
pub fn selected(value: a) -> #(String, a)
Defines a value which will be selected on page load.
pub fn size(value: a) -> #(String, a)
Defines the width of the element (in pixels). If the element’s type attribute is text or password then it’s the number of characters.
pub fn slot(value: a) -> #(String, a)
Assigns a slot in a shadow DOM shadow tree to an element.
pub fn spellcheck(value: a) -> #(String, a)
Indicates whether spell checking is allowed for the element.
pub fn style(value: a) -> #(String, a)
Defines CSS styles which will override styles previously set.
pub fn tabindex(value: a) -> #(String, a)
Overrides the browser’s default tab order and follows the one specified instead.
pub fn target(value: a) -> #(String, a)
Specifies where to open the linked document (in the case of an a element) or where to display the response received (in the case of a form element)
pub fn title(value: a) -> #(String, a)
Text to be displayed in a tooltip when hovering over the element.
pub fn translate(value: a) -> #(String, a)
Specify whether an element’s attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged.
pub fn value(value: a) -> #(String, a)
Defines a default value which will be displayed in the element on page load.
pub fn width(value: a) -> #(String, a)
For the elements listed here, this establishes the element’s width. Note: For all other instances, such as div , this is a legacy attribute, in which case the CSS width property should be used instead.