Lesson 4. Web Form Controls

HTML has always supported form controls using the <input> element, such as text boxes:

<input name="text" type="text">

or radio buttons:

<input name="radio" type="radio">

You create such controls using the <input> element with the type attribute set to the type of control you want (check box, radio button, text field), and the name attribute set to the name of the control as you’ll reference it in code (in a scripting language like JavaScript or a server-side language like PHP).

HTML5 extends the number of form controls available to you, adding such controls as a date-time picker and a numeric range control. Those new controls are the focus of this lesson.

We’ll also create an example in this lesson, webforms.html, ...

Get Sams Teach Yourself HTML5 in 10 Minutes now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.