What does the color input type let the user enter, and how did most browsers render it at the time of writing?
A color. Most browsers rendered it as a text field for a hexadecimal code or a color name (a color picker was expected in the future).
What does autofocus do, and how many elements on a form can use it?
It automatically gives the focus to the input element so the user can begin typing immediately. It is optional and can be used in only one input element on a form.
Three benefits of self-validating HTML5 input types
No need for complicated JavaScript validation code; less invalid data submitted; less Internet traffic between server and client to correct invalid input.
If inputs validate themselves on the client, should the server still validate?
Yes — the server should still validate all user input.
How do you bypass HTML5 validation when submitting?
Add the formnovalidate attribute to the submit input: <input type = "submit" value = "Submit" formnovalidate />
In what format does the date input expect a date?
yyyy-mm-dd, e.g. 2012-01-27.
datetime vs. datetime-local
datetime: date, time and the time zone set to UTC. datetime-local: date and time in a single control (year, month, day, hour, minute, second, fraction of a second) — no UTC time zone mentioned.
Formats of the month and week input types
month: yyyy-mm (e.g., 2012-01). week: yyyy-Wnn where nn is 01–53 (e.g., 2012-W01 = first week of 2012).
What must a time value contain according to the HTML5 specification?
Two digits for the hour, a colon (:), and two digits for the minute; optionally a colon and two digits for seconds and a period followed by one or more digits for a fraction of a second.
Does the email input type check whether an address really exists?
No. HTML5 only validates that the e-mail address is in the proper format. (With the multiple attribute it accepts a comma-separated list.)
What is placeholder text, and what happens to it on focus and on submit?
Temporary (usually light gray) text showing an example of what/how to enter. It disappears when the focus is placed in the field and is not submitted (unless the user types the same text).
For which input types does HTML5 support placeholder text?
Only six: text, search, url, tel, email and password.
What does the required attribute do, and which input types can use it?
It forces the user to enter a value before submitting the form. It can be added to any of the input types.
number input: min, max, step and value
min = minimum valid number; max = maximum valid number; step = increment in which numbers increase; value = initial value displayed.
How does range appear, and why is it inherently self-validating?
As a slider control. It is self-validating because the user cannot move the slider outside the minimum or maximum bounds.
How does the search input type compare with a text input?
It is functionally equivalent to an input of type text (Chrome and Safari show an X to clear it).
Does HTML5 self-validate the tel input type? How did the example enforce a format?
No. The example added a pattern attribute with a regular expression requiring the format (555) 555-5555.
Is www.deitel.com a valid value for a url input? What does HTML5 check?
No — the proper format is http://www.deitel.com. HTML5 checks only that the URL is in the proper format, not that it is valid/exists.
What does autocomplete do, and where would you turn it off?
Automatically fills in the user's information based on previous input (name, address, e-mail). It can be on for a whole form or specific elements; set it "off" for credit card and password inputs for security.
What does the datalist element provide, and how is it connected to the input?
Input options for a text input element. The input's list attribute names the datalist's id (Fig. 3.17: list = "months" and <datalist id = "months">).
header: what can it contain, and how often can it be used?
Text and graphics — headings (h1–h6), navigation, images and logos. It can be used multiple times on a page.
time and nav
time identifies a date, a time or both (it does not need to be inside a header). nav groups navigation links.
figure and figcaption
figure describes a figure (image, chart or table) so that it could be moved to the side or another page; figcaption provides its caption.
What is an article element? Can articles be nested?
Standalone content that could be used or distributed elsewhere (news article, forum post, blog entry). Yes — e.g., reader comments nested as an article within a magazine article.
Which element displays a right-pointing arrow next to a summary, and what happens when it is clicked?
The summary element. When clicked, the arrow points downward and reveals the content in the details element.
section vs. aside
section: a section of a document, usually with a heading (can be nested, also inside an article). aside: content related to the surrounding content but somewhat separate from the flow of the text (e.g., background history in a news story).
What does meter render? Give example values.
A visual representation of a measure within a range. Example: min = "0", max = "54" (total survey responses), value = "14" (people who answered yes).
What does footer describe, and what did the example put in it?
Content that usually appears at the bottom of the content or section element; the example used it for the copyright notice and contact information.
mark vs. wbr
mark highlights the text enclosed in it. wbr indicates the appropriate place to break a word when text wraps (to avoid an awkward break).