HTML Input Elements
Creates a single-line text entry control for search queries. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<input
autocomplete
list
maxlength
minlength
pattern
placeholder
required
size
>
NOTE: Only the <input
> start tag must be present. The element has no end tag.
The <input type=search
> element is a text field designed for the user to enter search queries into.
The control is functionally identical to text inputs, but may be styled differently by the user agent.
The <input_search>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following example displays an empty text control that can contain 15 characters without scrolling.
<input type=text id="txtName" name="txtName" size=15>
The following script detects the contents of the text box and displays it in a dialog box.
<script language="JavaScript">
function detectEntry ( ) {
alert ( "Hello " + txtName.value + ". Welcome to DHTML." );
}
</script>
The preceding HTML and script are implemented below. Click the button to call the function.
Enter your name:
INPUT TEXTAREA