Using the text input field
We will take a look at one of the basic examples of using input data with HTML <input type="text">
. This input type automatically removes line breaks from the input values, so it's intended for single line text usage as shown in the following screenshot:
How to do it...
In the body section of the HTML document, we will create a form where the inputs with type text
will be placed:
First we add the most basic input type
text
:<form> <p> First name <input name="firstname" type="text"> </p>
Following that, we add one where audio input will be enabled:
<p> Speak up <input name="quote" type="text" x-webkit-speech speech> </p>
Also add one with the
placeholder
attribute and one with theautofocus
attribute:<p> Last name: <input name="lastname" type="text" placeholder="John Doe"> </p> <label> Comment <input name="comment" type="text" title="This is area to insert your opinion...