INPUT Element | input Object

Creates a variety of form input controls.

Members Table

The following table lists the members exposed by the input object.

Attributes/Properties
AttributePropertyDescription
ACCEPTaccept Sets or retrieves a comma-separated list of content types.
ALIGNalign Sets or retrieves how the object is aligned with adjacent text.
ALTalt Sets or retrieves a text alternative to the graphic.
complete Retrieves whether the object is fully loaded.
constructor New for Windows Internet Explorer 8  Returns a reference to the constructor of an object.
DYNSRCdynsrc Sets or retrieves the address of a video clip or VRML world to display in the window.
HSPACEhspace Sets or retrieves the horizontal margin for the object.
LOOPloop Sets or retrieves the number of times a sound or video clip will loop when activated.
LOWSRClowsrc Sets or retrieves a lower resolution image to display.
startstart Sets or retrieves when a video clip file should begin playing.
USEMAPuseMap Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
VALUEvalue Sets or retrieves the displayed value for the control object. This value is returned to the server when the control object is submitted.
VSPACEvspace Sets or retrieves the vertical margin for the object.
Behaviors
BehaviorDescription
mask Grants a masked edit behavior to DHTML Objects.
Prototypes
ObjectDescription
HTMLInputElement Constructor New for Internet Explorer 8  Defines the properties and methods inherited by objects in the HTMLInputElement Constructor prototype chain.
Styles
Style attributeStyle propertyDescription
:active:active Sets the style of an element when it is engaged or active.
:first-child:first-child Applies one or more styles to any element that is the first child of its parent.
:hover:hover Sets the style of an element when the user hovers the mouse pointer over the element.
:lang New for Internet Explorer 8 :lang(C) In a document, selects the elements that are in a given language.
borderborder Sets or retrieves the properties to draw around the object.
-ms-layout-flowlayoutFlow Sets or retrieves the direction and flow of the content in the object.
-ms-text-underline-positiontextUnderlinePosition Sets or retrieves the position of the underline decoration that is set through the textDecoration property of the object.
-ms-word-wrapwordWrap Sets or retrieves whether to break words when the content exceeds the boundaries of its container.
-ms-writing-modewritingMode Sets or retrieves the direction and flow of the content in the object.
-ms-zoomzoom Sets or retrieves the magnification scale of the object.

Remarks

 New for Internet Explorer 8 Internet Explorer 8 and later. In IE8 mode, the title attribute is preferred over the alt attribute when specified as a pop-up tooltip. This applies only when the type attribute is set to image. For more information on IE8 mode, see Defining Document Compatibility.

The TYPE attribute for the INPUT element is used to specify one of the following form input controls:

buttoncheckboxfilehiddenimage
passwordradioresetsubmittext

This element is an inline element.

This element does not require a closing tag.

Example

This example uses the INPUT element to create different types of input controls.

<FORM ACTION="http://intranet/survey" METHOD=POST>
<P>Name</P>
<BR><INPUT NAME="CONTROL1" TYPE=TEXT VALUE="Your Name">
<P>Password</P>
<BR><INPUT TYPE="PASSWORD" NAME="CONTROL2">
<P>Color</P>
<BR><INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="0" CHECKED>Red
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="1">Green
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="2">Blue
<P>Comments</P>
<BR><INPUT TYPE="TEXT" NAME="CONTROL4" SIZE="20,5" MAXLENGTH="250">
<P><INPUT NAME="CONTROL5" TYPE=CHECKBOX CHECKED>Send receipt</P>
<P><INPUT TYPE="SUBMIT" VALUE="OK"><INPUT TYPE="RESET" VALUE="Reset"></P>
</FORM>

Standards Information

This object is defined in HTML 3.2 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

See Also

Tags :


Page view tracker