form
The HTML <form>
element represents a document section that contains interactive controls to submit information to a web server.
select - This attribute lets you specify the form element to which the select element is associated (that is, its "form owner"). If this attribute is specified, its value must be the ID of a form element in the same document. This enables you to place select elements anywhere within a document, not just as descendants of their form elements.
object - The form element, if any, that the object element is associated with (its form owner). The value of the attribute must be an ID of a <form>
element in the same document.
input - The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a <form>
element in the same document. If this attribute is not specified, this <input>
element must be a descendant of a <form>
element. This attribute enables you to place <input>
elements anywhere within a document, not just as descendants of their form elements. An input can only be associated with one form.
button - The form element that the button is associated with (its form owner). The value of the attribute must be the id attribute of a <form>
element in the same document. If this attribute is not specified, the <button>
element will be associated to an ancestor <form>
element, if one exists. This attribute enables you to associate <button>
elements to <form>
elements anywhere within a document, not just as descendants of <form>
elements.
output - The form element that this element is associated with (its "form owner"). The value of the attribute must be an ID of a form element in the same document. If this attribute is not specified, the output element must be a descendant of a form element. This attribute enables you to place output elements anywhere within a document, not just as descendants of their form elements.
label - The form element with which the label is associated (its form owner). If specified, the value of the attribute is the ID of a <form>
element in the same document. This lets you place label elements anywhere within a document, not just as descendants of their form elements.
This content attribute was removed from the HTML specification on April 28, 2016. However, scripts still have access to a read-only HTMLLabelElement.form
attribute; it returns the form of which the label's associated control is a member, or null
if the label is not associated with a control or the control isn't part of a form.
textarea - The form element that the <textarea>
element is associated with (its "form owner"). The value of the attribute must be the ID of a form element in the same document. If this attribute is not specified, the <textarea>
element must be a descendant of a form element. This attribute enables you to place <textarea>
elements anywhere within a document, not just as descendants of their form elements.
keygen - The form element that this element is associated with (its form owner). The value of the attribute must be an id
of a <form>
element in the same document. If this attribute is not specified, this element must be a descendant of a <form>
element. This attribute enables you to place <keygen>
elements anywhere within a document, not just as descendants of their form elements.
meter - This attribute associates the element with a form
element that has ownership of the meter
element. For example, a meter
might be displaying a range corresponding to an input
element of type
number. This attribute is only used if the meter
element is being used as a form-associated element; even then, it may be omitted if the element appears as a descendant of a form
element.
fieldset - This attribute has the value of the id attribute of the <form>
element it's related to. Its default value is the id of the nearest <form>
element it is a descendant of.
Attributes
- Graph
- Supertypes
- trait Attrtrait Tagclass Objecttrait Matchableclass Any
- Self type
- form.type