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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.