From the course: Building Great Forms with HTML and CSS

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Using ARIA

Using ARIA

- [Instructor] Let me show you how we can incorporate ARIA into an actual webpage. Here's the page that we're going to be working with. If we look at it in the browser you can see it looks like it has three distinctive forms. If you look in the HTML however, the first form field and the second form field are actually using a div, not a form tag. As you can see, I'm using the role=form attribute. This attribute defines a form landmark. We use the roles=form to identify a region of the page and tag it as being a specific type. So in this case as being a form. You would not use role to identify every form field but you would just put it on the overarching parent element. So in this case that is our div. You would never use role=form on a form tag since HTMLs semantics would imply this information. In addition to the role=form, I'm also using aria-labelledby and I have this set for the first form to be equal to…

Contents