2

I am working on a website to implement Ada compliance.

I am wondering which is better approach in terms of ADA compliance.

<label>Name:</label>
<input type="text" placeholder="Name" />

VS

<label>
 Name:
 <input type="text" placeholder="Name" />
</label>

Similarly for other input types such as select, radio button, checkbox etc.

Also we don't need labels in majority of forms as per design, so does it will make difference for ADA compliance if I add hidden labels for inputs?

Similar thing is asked in below question but its doesn't answer in terms of ADA.

Is it better to wrap the label tag around a form item or use the "for" attribute in HTML?

Thanks

4

1 回答 1

2

WebAIM.org gives advice on ADA and forms at the link below.

Creating Accessible Forms

Below is the method they recommended.

<label for="name">Name:</label>
<input id="name" type="text" name="textfield">

Whether hidden labels have any advantage or not in ADA is still a mystery.

于 2017-04-05T08:41:24.447 回答