SlideShare a Scribd company logo
Accessibility
&Forms
in HTML5

Aaron Gustafson
Easy Designs, LLC
slideshare.net/AaronGustafson
Accessibility & Forms




                    2
Accessibility & Forms




ARIA maps the OS to the web
Accessibility & Forms




Semantics+
Accessibility & Forms




Landmarks
help users
navigate
quickly
Accessibility & Forms




All the site’s a play...
The role attribute
Defines the part an element is playing (assuming it’s different than the
semantics would otherwise imply).

<section id="main" role="main">
 <!-- The primary content for the page would go here -->
</section>
Accessibility & Forms
Accessibility & Forms




<header role="banner">
Accessibility & Forms




<nav role="navigation">
Accessibility & Forms




<form role="search">
Accessibility & Forms




<section role="main">
Accessibility & Forms
Accessibility & Forms




<footer role="contentinfo">
Accessibility & Forms




<nav role="navigation">
Accessibility & Forms
Accessibility & Forms




<aside role="complementary">
Accessibility & Forms




Landmark roles
application
A region of the page representing a unique software unit executing a set of tasks for its
users. It is an area where assistive technologies should also return browse navigation
keys back over to the web application in this region.
banner
A region that contains the prime heading or internal title of a page.
complementary
A supporting section of the document that remains meaningful even when separated
from the main content.
contentinfo
Metadata that applies to the parent document.
form
A region of the document that represents a collection of form-associated elements.
main
navigation
search
Accessibility & Forms




Landmark roles
main
The main content of a document.
navigation
A collection of navigational elements (usually links) for navigating the document or
related documents.
search
The search tool of a web document.
Accessibility & Forms




Structural roles
article
columnheader
definition
directory
document
group
heading
img
list
listitem
math
note
presentation
region
row
rowheader
separator
Accessibility & Forms




<article role="article">
Accessibility & Forms
Accessibility & Forms




Structural roles
article
A section of a page that forms an independent part of a document, page, or site.
group
A set of user interface objects which are not intended to be included in a page summary
or table of contents by assistive technologies.
note
A section whose content is parenthetic or ancillary to the main content of the resource.
presentation
An element whose implicit native semantics will not be mapped to the accessibility API.
region
A large perceivable section of a web page or document, that the author feels is
important enough to be included in a page summary or table of contents.
separator
A divider that separates and distinguishes sections of content or groups of menu items.
Accessibility & Forms




Semantic comparison
       Ad-hoc             ARIA Role               HTML5

#header, #top      banner                header (kind of)


#main, #content    main                  none


#extra, .sidebar   complementary, note   aside


#footer, #bottom   contentinfo           footer


#nav               navigation            nav


.hentry            article               article
Accessibility & Forms




What is this!?
Accessibility & Forms




Widget roles
<span role="button">OK</span>
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>


<div role="alertdialog">
 <p>Something went wrong.</p>
 <img src="x.png" alt="dismiss" role="button" />
</div>
Accessibility & Forms




Widget roles
alert             marquee            slider
alertdialog       menuitem           spinbutton
button            menuitemcheckbox   status
checkbox          menuitemradio      tab
combobox          option             tabpanel
dialog            progressbar        textbox
gridcell          radio              timer
link              radiogroup         tooltip
log               scrollbar          treeitem



Widget Container Roles
grid              menubar            tree
listbox           tablist            treegrid
menu              toolbar
Accessibility & Forms




Widget properties
aria-activedescendant   aria-multiline
aria-atomic             aria-multiselectable
aria-autocomplete       aria-orientation
aria-controls           aria-owns
aria-describedby        aria-posinset
aria-dropeffect         aria-readonly
aria-flowto             aria-relevant
aria-haspopup           aria-required
aria-label              aria-setsize
aria-labelledby         aria-sort
aria-level              aria-valuemax
aria-live               aria-valuemin
Accessibility & Forms




What’s going on!?
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="not bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span role="button" aria-pressed="false">
 <img src="bold-off.png" alt="not bold" />
</span>
<span role="button" aria-pressed="true">
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
aria-busy
aria-checked
aria-disabled
aria-expanded
aria-grabbed
aria-hidden
aria-invalid
aria-pressed
aria-selected
aria-valuenow (the W3C defines this as a “property”)
aria-valuetext (ditto)
Accessibility & Forms




Highlighting living content
Accessibility & Forms




Live regions
Accessibility & Forms




Live regions




<input class="tweet-counter" value="140" disabled="disabled">
Accessibility & Forms




Live regions




<span id="chars_left_notice" class="numeric">
 <strong id="status-field-char-counter"
       class="char-counter">140</strong>
</span>
Accessibility & Forms




Live regions




<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>


.hidden {
  position: absolute;
  left: −999em;
}
Accessibility & Forms




Live regions




<span class="tweet-counter">maximum of 140 characters</span>



<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>
Accessibility & Forms




Live regions




<span aria-live="polite" aria-atomic="true"
      class="tweet-counter">140<b class="hidden">
      characters remaining</b></span>
Accessibility & Forms




Live regions
Accessibility & Forms




Notification options
off
change not announced

polite
change announced after user completes her current activity

assertive
user agent should interrupt the user’s activity, but not immediately
Accessibility & Forms




Who is Supporting WAI-ARIA?
Accessibility & Forms




For more
WAI-ARIA Spec
w3.org/TR/wai-aria/


WAI-ARIA Support in Browsers
paciellogroup.com/blog/aria-tests/ARIA-SafariaOperaIEFF.html
Accessibility & Forms




Fixing “broken” tables
Accessibility & Forms




HTML4 best practice
<table summary="Characteristics are given in the second column, with the negative
side in the left column and the positive side in the right column">
  <caption>Characteristics with positive and negative sides</caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Sad</td>
      <th scope="row">Mood</th>
      <td>Happy</td>
    </tr>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<p>In the following table, characteristics are given in the second
  column, with the negative side in the left column and the positive
  side in the right column.</p>
<table>
  <caption>Characteristics with positive and negative sides</caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<table>
  <caption>
    <strong>Characteristics with positive and negative sides.</strong>
    <p>Characteristics are given in the second column, with the
      negative side in the left column and the positive side in the right
      column.</p>
  </caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<table>
  <caption>
    <strong>Characteristics with positive and negative sides.</strong>
    <details>
      <summary>Help</summary>
      <p>Characteristics are given in the second column, with the
         negative side in the left column and the positive side in the right
         column.</p>
    </details>
  </caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<figure>
  <figcaption>Characteristics with positive and negative sides</figcaption>
  <p>Characteristics are given in the second column, with the
    negative side in the left column and the positive side in the right
    column.</p>
  <table>
    <thead>
      <tr>
         <th scope="col">Negative</th>
         <th scope="col">Characteristic</th>
         <th scope="col">Positive</th>
      </tr>
    </thead>
    <tbody>
      <!-- … -->
    </tbody>
  </table>
</figure>
Accessibility & Forms




HTML5 options
<table>
 <thead>
    <tr>
      <th scope="col">Characteristic</th>
      <th scope="col">Negative</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Mood</th>
      <td>Sad</td>
      <td>Happy</td>
    </tr>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




More usable forms
Accessibility & Forms




Dates and times
<input type=”datetime”>
A UI control for selecting a date and time that includes timezone information.

<input type=”datetime-local”>
A UI control for selecting a date and time that does not include timezone information.

<input type=”date”>
A UI control for selecting a date with access to all date components
(day, month and year).

<input type=” month”>
A UI control for selecting a date that provides access to month and year only.

<input type=”time”>
A UI control for selecting a time that does not include timezone information.

<input type=”week”>
A UI control for selecting a date that provides access to week and year only.
Accessibility & Forms




Dates and times



             Safari




                                  Opera



<input type="date" name="dob"/>
Accessibility & Forms




Numbers
<input type=”number”>
A UI control for selecting a number.

<input type=”range”>
A UI control for selecting an imprecise number.
Accessibility & Forms




Numbers


<input type="number" name="foo"/>




<input type="range" min="1" max="11" name="foo"/>
Accessibility & Forms




New types
<input type=”email”>
A UI control for entering an email.

<input type=”url”>
A UI control for entering a URL.

<input type=”tel”>
A UI control for entering a telephone number.
Accessibility & Forms




New types




  <input type="email" …/>   <input type="url" …/>
Accessibility & Forms




New types
<input type=”search”>
A UI control for plain text editing of one or more search terms.




                    my search terms                         x
Accessibility & Forms




New types
<input type=”color”>
A UI control for selecting a color.


                        #EC4D0E
Accessibility & Forms




UI control attributes
autocomplete
Tells the User Agent whether or not the value should be stored.

autofocus
Tells the User Agent to bring focus to the form control on page load.

form
An id reference to the form to which a given control belongs.

required
Indicated the form control must be provided a value.

placeholder
Offers users a short hint about the required value.
Accessibility & Forms




Value control
min and max
Lower and upper boundary for an element value (dates, time, and numbers only).

step
The granularity of values allowed (dates, time, and numbers only).


 <input type="range" min="1" max="11" step="0.5" .../>
Accessibility & Forms




Value control
pattern
A regular expression pattern that the User Agent should validate the input against.

 <input type="text"
        pattern="d{6}w{3}"
        placeholder="6 digits followed by 3 letters"
        .../>
Accessibility & Forms




Value control
pattern
An id reference to a datalist element containing acceptable values.

 <input type="text" list="countries" name="country"/>
 <datalist id="countries">
  <option>Afghanistan</option>
  <option>Åland Islands</option>
  <!-- ... -->
 </datalist>
Accessibility & Forms




             Slides available at
  http://slideshare.net/AaronGustafson

     This presentation is licensed under
             Creative Commons
Attribution-Noncommercial-Share Alike 3.0

          flickr Photo Credits
          “HTML5 logo in Braille” by Ted Drake
         “Dual Samsung Monitors” by steve-uk
                “Statue of Liberty” by gadl
                   “Lego” by DavePress
            “iFlickr touch screen” by exfordy
               “Green Plant” by kevin1024

More Related Content

PDF
Sakai Meet MORPHEUS: Slides
PPTX
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
PPTX
Accessibility of HTML5 and Rich Internet Applications - CSUN 2012
PPTX
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
PPTX
Accessible web applications
PDF
Building accessible web components without tears
PPTX
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
PPTX
Accessibility with Single Page Apps
Sakai Meet MORPHEUS: Slides
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
Accessibility of HTML5 and Rich Internet Applications - CSUN 2012
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessible web applications
Building accessible web components without tears
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
Accessibility with Single Page Apps

Similar to HTML5 Accessibility (20)

PPTX
Web accessibility
PPTX
Web accessibility workshop 4
PDF
aria_with_kissy
PPTX
How HTML5 and WAI-ARIA Can Improve Virtual Space of Universities
PPTX
Creating dynamic and accessible content in Drupal 7 using WAI-ARIA
PDF
Building a better, accessible web
PPTX
Website development accessibility
PPT
Web Accessibility
PPT
HTML5 Accessibility CSUN 2012
PDF
Next generation web accessibility: Improvement of usability for disabled users
PPTX
Dynamic and accessible web content with WAI-ARIA
PDF
a11yTO - Web Accessibility for Developers
PDF
Accessibility - A feature you can build
PDF
Keyboard and Interaction Accessibility Techniques
PPTX
Workflow Essentials for Web Development
PDF
Web Accessibility - We're All In This Together!
KEY
Are you accessible
PDF
How Accessibility Made Me a Better Developer
PPT
Accessible & Usable Web Forms. Your How To Guide!
PPTX
Accessibility and universal usability
Web accessibility
Web accessibility workshop 4
aria_with_kissy
How HTML5 and WAI-ARIA Can Improve Virtual Space of Universities
Creating dynamic and accessible content in Drupal 7 using WAI-ARIA
Building a better, accessible web
Website development accessibility
Web Accessibility
HTML5 Accessibility CSUN 2012
Next generation web accessibility: Improvement of usability for disabled users
Dynamic and accessible web content with WAI-ARIA
a11yTO - Web Accessibility for Developers
Accessibility - A feature you can build
Keyboard and Interaction Accessibility Techniques
Workflow Essentials for Web Development
Web Accessibility - We're All In This Together!
Are you accessible
How Accessibility Made Me a Better Developer
Accessible & Usable Web Forms. Your How To Guide!
Accessibility and universal usability
Ad

More from Aaron Gustafson (20)

PDF
Delivering Critical Information and Services [JavaScript & Friends 2021]
PDF
Adapting to Reality [Guest Lecture, March 2021]
PDF
Designing the Conversation [Beyond Tellerrand 2019]
PPTX
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
PDF
Progressive Web Apps: Where Do I Begin?
PDF
Media in the Age of PWAs [ImageCon 2019]
PDF
Adapting to Reality [Starbucks Lunch & Learn]
PDF
Conversational Semantics for the Web [CascadiaJS 2018]
PDF
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PDF
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PDF
Designing the Conversation [Concatenate 2018]
PDF
Designing the Conversation [Accessibility DC 2018]
PDF
Performance as User Experience [AEADC 2018]
PDF
The Web Should Just Work for Everyone
PDF
Performance as User Experience [AEA SEA 2018]
PDF
Performance as User Experience [An Event Apart Denver 2017]
PDF
Advanced Design Methods 1, Day 2
PDF
Advanced Design Methods 1, Day 1
PDF
Designing the Conversation [Paris Web 2017]
PDF
Exploring Adaptive Interfaces [Generate 2017]
Delivering Critical Information and Services [JavaScript & Friends 2021]
Adapting to Reality [Guest Lecture, March 2021]
Designing the Conversation [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Progressive Web Apps: Where Do I Begin?
Media in the Age of PWAs [ImageCon 2019]
Adapting to Reality [Starbucks Lunch & Learn]
Conversational Semantics for the Web [CascadiaJS 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Accessibility DC 2018]
Performance as User Experience [AEADC 2018]
The Web Should Just Work for Everyone
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [An Event Apart Denver 2017]
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 1
Designing the Conversation [Paris Web 2017]
Exploring Adaptive Interfaces [Generate 2017]
Ad

HTML5 Accessibility

  • 1. Accessibility &Forms in HTML5 Aaron Gustafson Easy Designs, LLC slideshare.net/AaronGustafson
  • 3. Accessibility & Forms ARIA maps the OS to the web
  • 5. Accessibility & Forms Landmarks help users navigate quickly
  • 6. Accessibility & Forms All the site’s a play... The role attribute Defines the part an element is playing (assuming it’s different than the semantics would otherwise imply). <section id="main" role="main"> <!-- The primary content for the page would go here --> </section>
  • 9. Accessibility & Forms <nav role="navigation">
  • 10. Accessibility & Forms <form role="search">
  • 13. Accessibility & Forms <footer role="contentinfo">
  • 14. Accessibility & Forms <nav role="navigation">
  • 16. Accessibility & Forms <aside role="complementary">
  • 17. Accessibility & Forms Landmark roles application A region of the page representing a unique software unit executing a set of tasks for its users. It is an area where assistive technologies should also return browse navigation keys back over to the web application in this region. banner A region that contains the prime heading or internal title of a page. complementary A supporting section of the document that remains meaningful even when separated from the main content. contentinfo Metadata that applies to the parent document. form A region of the document that represents a collection of form-associated elements. main navigation search
  • 18. Accessibility & Forms Landmark roles main The main content of a document. navigation A collection of navigational elements (usually links) for navigating the document or related documents. search The search tool of a web document.
  • 19. Accessibility & Forms Structural roles article columnheader definition directory document group heading img list listitem math note presentation region row rowheader separator
  • 22. Accessibility & Forms Structural roles article A section of a page that forms an independent part of a document, page, or site. group A set of user interface objects which are not intended to be included in a page summary or table of contents by assistive technologies. note A section whose content is parenthetic or ancillary to the main content of the resource. presentation An element whose implicit native semantics will not be mapped to the accessibility API. region A large perceivable section of a web page or document, that the author feels is important enough to be included in a page summary or table of contents. separator A divider that separates and distinguishes sections of content or groups of menu items.
  • 23. Accessibility & Forms Semantic comparison Ad-hoc ARIA Role HTML5 #header, #top banner header (kind of) #main, #content main none #extra, .sidebar complementary, note aside #footer, #bottom contentinfo footer #nav navigation nav .hentry article article
  • 25. Accessibility & Forms Widget roles <span role="button">OK</span>
  • 26. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better)
  • 27. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div>
  • 28. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div> <div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /> </div>
  • 29. Accessibility & Forms Widget roles alert marquee slider alertdialog menuitem spinbutton button menuitemcheckbox status checkbox menuitemradio tab combobox option tabpanel dialog progressbar textbox gridcell radio timer link radiogroup tooltip log scrollbar treeitem Widget Container Roles grid menubar tree listbox tablist treegrid menu toolbar
  • 30. Accessibility & Forms Widget properties aria-activedescendant aria-multiline aria-atomic aria-multiselectable aria-autocomplete aria-orientation aria-controls aria-owns aria-describedby aria-posinset aria-dropeffect aria-readonly aria-flowto aria-relevant aria-haspopup aria-required aria-label aria-setsize aria-labelledby aria-sort aria-level aria-valuemax aria-live aria-valuemin
  • 32. Accessibility & Forms Widget states B B (off) (on) <span> <img src="bold-off.png" alt="bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 33. Accessibility & Forms Widget states B B (off) (on) <span> <img src="bold-off.png" alt="not bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 34. Accessibility & Forms Widget states B B (off) (on) <span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /> </span> <span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /> </span>
  • 35. Accessibility & Forms Widget states aria-busy aria-checked aria-disabled aria-expanded aria-grabbed aria-hidden aria-invalid aria-pressed aria-selected aria-valuenow (the W3C defines this as a “property”) aria-valuetext (ditto)
  • 38. Accessibility & Forms Live regions <input class="tweet-counter" value="140" disabled="disabled">
  • 39. Accessibility & Forms Live regions <span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong> </span>
  • 40. Accessibility & Forms Live regions <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span> .hidden { position: absolute; left: −999em; }
  • 41. Accessibility & Forms Live regions <span class="tweet-counter">maximum of 140 characters</span> <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>
  • 42. Accessibility & Forms Live regions <span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>
  • 44. Accessibility & Forms Notification options off change not announced polite change announced after user completes her current activity assertive user agent should interrupt the user’s activity, but not immediately
  • 45. Accessibility & Forms Who is Supporting WAI-ARIA?
  • 46. Accessibility & Forms For more WAI-ARIA Spec w3.org/TR/wai-aria/ WAI-ARIA Support in Browsers paciellogroup.com/blog/aria-tests/ARIA-SafariaOperaIEFF.html
  • 47. Accessibility & Forms Fixing “broken” tables
  • 48. Accessibility & Forms HTML4 best practice <table summary="Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column"> <caption>Characteristics with positive and negative sides</caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <tr> <td>Sad</td> <th scope="row">Mood</th> <td>Happy</td> </tr> <!-- … --> </tbody> </table>
  • 49. Accessibility & Forms HTML5 options <p>In the following table, characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> <table> <caption>Characteristics with positive and negative sides</caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 50. Accessibility & Forms HTML5 options <table> <caption> <strong>Characteristics with positive and negative sides.</strong> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> </caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 51. Accessibility & Forms HTML5 options <table> <caption> <strong>Characteristics with positive and negative sides.</strong> <details> <summary>Help</summary> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> </details> </caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 52. Accessibility & Forms HTML5 options <figure> <figcaption>Characteristics with positive and negative sides</figcaption> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> <table> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table> </figure>
  • 53. Accessibility & Forms HTML5 options <table> <thead> <tr> <th scope="col">Characteristic</th> <th scope="col">Negative</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <tr> <th scope="row">Mood</th> <td>Sad</td> <td>Happy</td> </tr> <!-- … --> </tbody> </table>
  • 55. Accessibility & Forms Dates and times <input type=”datetime”> A UI control for selecting a date and time that includes timezone information. <input type=”datetime-local”> A UI control for selecting a date and time that does not include timezone information. <input type=”date”> A UI control for selecting a date with access to all date components (day, month and year). <input type=” month”> A UI control for selecting a date that provides access to month and year only. <input type=”time”> A UI control for selecting a time that does not include timezone information. <input type=”week”> A UI control for selecting a date that provides access to week and year only.
  • 56. Accessibility & Forms Dates and times Safari Opera <input type="date" name="dob"/>
  • 57. Accessibility & Forms Numbers <input type=”number”> A UI control for selecting a number. <input type=”range”> A UI control for selecting an imprecise number.
  • 58. Accessibility & Forms Numbers <input type="number" name="foo"/> <input type="range" min="1" max="11" name="foo"/>
  • 59. Accessibility & Forms New types <input type=”email”> A UI control for entering an email. <input type=”url”> A UI control for entering a URL. <input type=”tel”> A UI control for entering a telephone number.
  • 60. Accessibility & Forms New types <input type="email" …/> <input type="url" …/>
  • 61. Accessibility & Forms New types <input type=”search”> A UI control for plain text editing of one or more search terms. my search terms x
  • 62. Accessibility & Forms New types <input type=”color”> A UI control for selecting a color. #EC4D0E
  • 63. Accessibility & Forms UI control attributes autocomplete Tells the User Agent whether or not the value should be stored. autofocus Tells the User Agent to bring focus to the form control on page load. form An id reference to the form to which a given control belongs. required Indicated the form control must be provided a value. placeholder Offers users a short hint about the required value.
  • 64. Accessibility & Forms Value control min and max Lower and upper boundary for an element value (dates, time, and numbers only). step The granularity of values allowed (dates, time, and numbers only). <input type="range" min="1" max="11" step="0.5" .../>
  • 65. Accessibility & Forms Value control pattern A regular expression pattern that the User Agent should validate the input against. <input type="text" pattern="d{6}w{3}" placeholder="6 digits followed by 3 letters" .../>
  • 66. Accessibility & Forms Value control pattern An id reference to a datalist element containing acceptable values. <input type="text" list="countries" name="country"/> <datalist id="countries"> <option>Afghanistan</option> <option>Åland Islands</option> <!-- ... --> </datalist>
  • 67. Accessibility & Forms Slides available at http://slideshare.net/AaronGustafson This presentation is licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 flickr Photo Credits “HTML5 logo in Braille” by Ted Drake “Dual Samsung Monitors” by steve-uk “Statue of Liberty” by gadl “Lego” by DavePress “iFlickr touch screen” by exfordy “Green Plant” by kevin1024