HTML5 Guidelines for Web Developers

(coco) #1
1.3 In Medias Res 11

The input element also entails many changes. Here is a brief summary of new
types: You now have several new input types for specifying the date with date-
time, date, month, week, time, and datetime-local. Also, there are types for search
fields (search) and for entering URLs (url), e-mail addresses (email), telephone
numbers (tel), numbers (number) or numeric ranges (range), or colors (color). As
you can see in Figure 1.3, many of the new attributes relate to forms. Thanks to
the form attribute, input elements can be external to the form in question and be,
as it were, linked to the desired form. Attributes, such as min, max, step, required,
pattern, multiple, or autocomplete determine restrictions or conditions for in-
put elements, influence the validation of the entered data with formnovalidate
and novalidate, and offer practical help for filling in forms with placeholder or
autofocus. What happens when the form is submitted can be overwritten in in-
put and button elements with formmethod, formenctype, formtarget, and formac-
tion. The list attribute serves to assign selection lists created with datalist to
the relevant input component.


As security features for iframes, we have sandbox, srcdoc, and seamless. These
isolate the embedded content from the rest of the document. If you want to load
scripts asynchronously, you can use async, and ping opens the list of URLs speci-
fied in the ping attribute in the background whenever you click on a hyperlink.


Figure 1.3 New HTML5 attributes

Free download pdf