The <form> Element
As defined in the HTML Living Standard, the <form> element represents a document section containing interactive controls for submitting information.
<form action="/submit-demo" method="post">
<label for="user-name">Name:</label>
<input type="text" id="user-name" name="username">
<label for="user-email">Email:</label>
<input type="email" id="user-email" name="email">
<button type="submit">Submit Information</button>
</form>
View HTML Living Standard: The form element
Key Attributes for Accessibility
The <form> element provides critical context to assistive technologies through its attributes:
action: Specifies where to send the form-data when a form is submitted.method: The HTTP method to use (usuallyGETorPOST).novalidate: A boolean attribute that indicates the form should not be validated on submission.
WCAG Requirement: Form Landmarks
While the <form> element is not a landmark by default, it is highly recommended to wrap complex forms in a <section> or <main> with an aria-labelledby attribute. This allows screen reader users to jump directly to the form using landmark navigation.
Common Pitfalls
A11y Tip: Avoid Nested Forms
HTML specifications strictly forbid nesting one <form> inside another. Doing so creates unpredictable behavior across browsers and confuses assistive technologies, often resulting in the inner form being ignored or the outer form submitting prematurely.