<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:

ValueDescription
ButtonCreates a button on the page.
CheckboxCreates a checkbox.
FileCreates a text box with a file browse button. The text box allows a user to select a file to upload to the server.
HiddenStores information that is not visible on the web page. This information can be viewed in the source HTML code.
ImageCreates an image that will submit the contents of its form to the server when it is clicked.
PasswordCreates a text box that displays an asterisk in place of each character that a user enters.
RadioCreates a radio button for single choice. Each radio button must have the same value for its name attribute.
ResetCreates a reset button which will reset the original values of the form.
SubmitCreates a submit button which will submit the contents of the form to the server.
TextCreates 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>
  
Click to view the demo

From here:

Home 
  HTML CSS Book 
    HTML reference  

Tag:
  1. <a>
  2. <acronym>
  3. <address>
  4. <area>
  5. <article>
  6. <aside> for SideBar
  7. <audio>
  8. <b>
  9. <base>
  10. <bdi>
  11. <bdo>
  12. <blockquote>
  13. <body>
  14. <br>
  15. <button>
  16. <canvas>
  17. <caption>
  18. <cite>
  19. <code>
  20. <col>
  21. <colgroup>
  22. <dd>
  23. <del>
  24. <details> for expandable section
  25. <dfn>
  26. <div>
  27. <dl>
  28. <!DOCTYPE>
  29. <dt>
  30. <em>
  31. <embed>
  32. <fieldset>
  33. <figure> for content with caption
  34. <footer> for footers
  35. <form>
  36. <frame>
  37. <frameset>
  38. <head>
  39. <header> for headers
  40. <hgroup> for header grouping
  41. <hN>
  42. <hr>
  43. <html>
  44. <i>
  45. <iframe>
  46. <img>
  47. <input>
  48. <ins>
  49. <kbd>
  50. <keygen>
  51. <label>
  52. <legend>
  53. <li>
  54. <link>
  55. <mark> to highlight
  56. <map>
  57. <meta>
  58. <meter>
  59. <nav> for navigation
  60. <noscript>
  61. <object>
  62. <ol>
  63. <output>
  64. <optgroup>
  65. <option>
  66. <p>
  67. <param>
  68. <pre>
  69. <progress>
  70. <q>
  71. <ruby>, <rt>, and <rp> Elements
  72. <rt>
  73. <ruby>
  74. <samp>
  75. <script>
  76. <section> marks sections
  77. <select>
  78. <span>
  79. <strong>
  80. <style>
  81. <sub>
  82. <sup>
  83. <table>
  84. <tbody>
  85. <td>
  86. <textarea>
  87. <tfoot>
  88. <thead>
  89. <th>
  90. <time> for date and time
  91. <title>
  92. <tr>
  93. <ul>
  94. <var>
  95. <video>
Related: