HTML input tag

The <input> tag is written as <input> (no end tag). An <input> tag is typically given a type attribute to specify the type of control, and a name attribute so that the form processor can make a reference to it. Often a value attribute is used to specify the default value of the form control.

There are a lot of other attributes that can be used with the <input> tag. These are listed below under “Template”.

Here’s a basic example of the syntax for the <input> tag with some attributes:

<form action="/html/tags/html_form_tag_action.cfm" target="_blank" method="get">
<p><label>First name: <input type="text" name="first_name" maxlength="100" style="width:120px;"></label></p>
<p><label>Last name: <input type="text" name="last_name" maxlength="100" style="width:120px;"></label></p>
<input type="submit" value="Submit" />
</form>

Eg. :