Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
HTML5 has breathed new life into the <input> tag. It’s time to get excited once
again about this “age-old” tag.
I have to admit that I was getting a little bored with the <input> tag. Before HTML5, any real
interaction had to be done outside the tag: whether the interaction
involved validation, formatting, or graphical presentation, JavaScript was
a necessary polyfill. Well, HTML5 has given us a reason to be excited
about the <input> tag
again.
The <input> tag is not
truly an HTML5 tag, per se. It’s the same <input> tag we have had in every previous
version of HTML, but HTML5 has added a slew of new features. The good
thing about updating an existing tag is that it’s naturally
backward-compatible. You may code your tag like this: