Why use an ordered list for an html form to improve accessibility?
Why would you use an ordered list within a form to improve 开发者_如何学JAVAaccessibility?
You may want to checkout the 'A List Apart' article on Prettier Accessible Forms which goes into some details as to why ordered lists are used in many forms.
It is mainly to do with screen readers "Additionally, the ol provides additional information for some screen readers that announce the number of list-items when they first encounter the list."
Hope this helps
Not necessarily <ol>
but <ul>
can also prove useful - as it adds additional context and acts as a delighter as the screen-reader will announce up front the number of list items - regardless of it being ordered or not.
Having said that, it's a fairly minimal improvement as many disabled users will navigate in forms mode and discover the input fields like that. It is miles more important to have your form fields accessible and semantically correct, than putting them in <li>
tags, so do focus on that first.
精彩评论