General Form-Control Attributes
The many form-control tags contain common attributes that, like most other tags, generally serve to label, set up the display, extend the text language, and make the tag extensible programmatically.
The id and title Attributes
The id attribute, as for most
other standard tags, lets you attach a unique string label to the form
control and its contents for reference by programs (applets) and
hyperlinks. This name is distinct from the name assigned to a control
element with the name attribute.
Names assigned with the id
attribute are not passed to the server when the form is
processed.
The title attribute is
similar to id in that it uses a
quote-enclosed string value to label the form control. However, it
titles only the form segment; you cannot use its value in an applet
reference or hyperlink. Browsers may use the title as pop-up help for
the user or in nonvisual presentation of the form. [The id attribute, 4.1.1.4]
[The title attribute,
4.1.1.5]
The event Attributes
Like most other elements, most of the form controls support a number of user mouse and keyboard event-related attributes that the HTML 4/XHTML-compliant browser recognizes and lets you specially process using JavaScript or a Java applet, for example. We describe the majority of these events in detail in Chapter 12.
The style, class, lang, and dir Attributes
The style attribute for the various form controls creates an inline style for the elements enclosed by the tag, overriding any other ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access