<input>
Description:
This element allows a web page to receive information from the user and to send the information to a server. All <input> elements must be placed within the <form> element's opening and closing tags.
The <input> element's type attribute determines which the input control will be displayed on the page. These are the possible type attribute values:
Value | Description |
---|---|
Button | Creates a button on the page. |
Checkbox | Creates a checkbox. |
File | Creates a text box with a file browse button. The text box allows a user to select a file to upload to the server. |
Hidden | Stores information that is not visible on the web page. This information can be viewed in the source HTML code. |
Image | Creates an image that will submit the contents of its form to the server when it is clicked. |
Password | Creates a text box that displays an asterisk in place of each character that a user enters. |
Radio | Creates a radio button for single choice. Each radio button must have the same value for its name attribute. |
Reset | Creates a reset button which will reset the original values of the form. |
Submit | Creates a submit button which will submit the contents of the form to the server. |
Text | Creates a text box. |
Syntax:
<input attributes events>
Example:
<html>
<head>
<title>input element example</title>
</head>
<body>
<form name="form2" method="post" action="">
<p>This is a form with several input elements.</p>
<input type="text" name="textfield2" value="This is a text field" size="30"><br>
<input type="checkbox" name="checkbox2" value="checkbox"> A checkbox.<br>
<input type="radio" name="radiobutton" value="radiobutton1">
<input type="radio" name="radiobutton" value="radiobutton2"> A set of radio buttons.<br>
<input type="button" name="myButton2" value="Submit"> A submit button.<br>
<input type="button" name="myButton2" value="Reset"> A reset button.<br>
<br> <input type="image" border="0" name="imageField" src="http://java2s.com/Book/HTML-CSSImages/star.png" width="300" height="225" alt="An input image">
</form>
</body>
</html>
From here:
Home
HTML CSS Book
HTML reference
HTML CSS Book
HTML reference
Tag:
- <a>
- <acronym>
- <address>
- <area>
- <article>
- <aside> for SideBar
- <audio>
- <b>
- <base>
- <bdi>
- <bdo>
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <cite>
- <code>
- <col>
- <colgroup>
- <dd>
- <del>
- <details> for expandable section
- <dfn>
- <div>
- <dl>
- <!DOCTYPE>
- <dt>
- <em>
- <embed>
- <fieldset>
- <figure> for content with caption
- <footer> for footers
- <form>
- <frame>
- <frameset>
- <head>
- <header> for headers
- <hgroup> for header grouping
- <hN>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <keygen>
- <label>
- <legend>
- <li>
- <link>
- <mark> to highlight
- <map>
- <meta>
- <meter>
- <nav> for navigation
- <noscript>
- <object>
- <ol>
- <output>
- <optgroup>
- <option>
- <p>
- <param>
- <pre>
- <progress>
- <q>
- <ruby>, <rt>, and <rp> Elements
- <rt>
- <ruby>
- <samp>
- <script>
- <section> marks sections
- <select>
- <span>
- <strong>
- <style>
- <sub>
- <sup>
- <table>
- <tbody>
- <td>
- <textarea>
- <tfoot>
- <thead>
- <th>
- <time> for date and time
- <title>
- <tr>
- <ul>
- <var>
- <video>
Related: