The <input> Tag

The input element is used to add interactivity to HTML documents through the use of controls such as edit boxes, checkboxes and buttons. Although it is possible to use inputs anywhere in the document it is customary to use an HTML form as the parent for such elements. Inputs are extremely talented creatures. By setting their type attribute it is possible to make them behave like one of a whole host of controls. This is discussed in some detail below. There are some attributes specific to the input element and other more generic ones.

Inputs are inline elements. Therefore, in order to layout inputs the developer must either code in <br> tags or use CSS styling with changes to the display attribute where required. With one important exception, all input elements are amenable to CSS styling. There are browser-dependant limitations on what can be accomplished as described here. The exception is the file upload input subtype which is wholly unresponsive to CSS styling. This is a security feature implemented by all browsers - the thinking is that the appearance of a control which when interacted with provides access to the file system of the browser host should not be subject to modification. We discuss a workaround to this problem here.

Jump To...

Colophon