O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

Using the text input field

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:

  1. First we add the most basic input type text:
    <form>
      <p>
        First name  <input name="firstname" type="text">
      </p>
  2. Following that, we add one where audio input will be enabled:
      <p>
        Speak up <input name="quote" type="text" x-webkit-speech speech>
      </p>
  3. Also ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required