Main /

Html Form Elements


[-edit SideBar-]

Html Form Elements

HTML FORM Elements


NameTypeChild ofAttributesEnd Tag?DescriptionReplacement
FORMblockBODY *action, enctype, method (get/post), target, (accept-charset) interactive form
BUTTONinputname, type, value push button
INPUTinputalign, checked, maxlength, name, size, src, type (button/checkbox/file/image/hidden/radio/submit/text), valueNoform control
LEGENDFIELDSET legend for/in fieldset
FIELDSETgroupingalign form control group
MAPinputname client-side image map
AREAMAPalt, coords, href, nohref, shapeNoclient-side image map area
SELECTinputmultiple, name, size option selector
OPTGROUPgroupingSELECTlabel option group
OPTIONSELECT, OPTGROUPlabel, selected, valueOptselectable choice
TEXTAREAinputcols, name, rows multi-line text field


beginning in HTML version 5, all visible input elements (except INPUT of type image, reset and submit) have the "form" and "required" attributes.
The INPUT and BUTTON elements can have the attributes "formaction", "formenctype", "formnovalidate" and "formtarget" to override the formīs defaults.

NameTypeChild ofAttributesEnd Tag?DescriptionReplacement
FORMblockBODY *action, (accept-)charset, autocomplete(on/off), enctype, method (delete/get/post/put), novalidate, target interactive form
BUTTONinputautofocus, disabled, name, type, value (accesskey) push button
INPUTinputalign, autofocus, checked, disabled, name, size, src, type (button/checkbox/color/file/hidden/image/radio/submit), value (accesskey)Noform control (special). see more types below.
INPUTinput...autocomplete, list, min, max, maxlength, pattern, placeholder, step, type (date/datetime/datetime-local/email/month/number/range/search/tel/text/time/url/week), plus: multiple, for type=email/file, plus: height, width for type=imageNoform control (data input). see more attributes above.
KEYGENautofocus, challenge, disabled, keytype(=rsa,...), type=keygen for public-key-encryption
LABELfor field label
LEGEND fieldset legend
FIELDSETgroupingLEGENDalign, disabled (accesskey) form control group
MAPinputname client-side image map
AREAMAPalt, coords, href, hreflang, ping, rel, shape, targetNoclient-side image map area"nohref" attribute is being dropped.
OUTPUTfor, name, type=output for script output
SELECTinputautofocus, multiple, name, size (accesskey) option selector
OPTGROUPgroupingSELECTlabel option group
OPTIONINPUT, SELECT, OPTGROUPlabel, selected, valueOptselectable choice
TEXTAREAinputautofocus, cols, disabled, name, placeholder, readonly, rows, wrap(=hard/soft) (accesskey) multi-line text field
Recent Changes (All) | Edit SideBar Page last modified on May 14, 2011, at 11:18 PM Edit Page | Page History
Powered by TechnoloWiki