WCAG Error: Broken Rule Regarding Label for Email Input (What am I missing?)

Brady

New Member
#1
I might be losing my mind. I keep getting an error in multiple accessibility tests stating that my form doesn't have a label. I added the for="EMAIL" for the label. Am I missing something?
Mã:
<p>
    <label for="EMAIL">Email address: </label>
    <input type="email" name="EMAIL" placeholder="Your email address" required />
</p>

<p>
    <input type="submit" value="Sign up" name="signup"/>
</p>
 

Admin

Administrator
Thành viên BQT
#2
The for attribute on the <label> object is designed to be used with an id attribute.
Try:
Mã:
<input type="email" name="EMAIL" id="EMAIL" placeholder="Your email address" required />
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Chủ Đề Xem Nhiều

Top