/    Sign up×
Community /Pin to ProfileBookmark

I have:

<label for=”x”>Label Name: <input name=”x” id=”x” … /></label>

My buddy has:

<p><label for=”x”>Label Name:</label> <input name=”x” id=”x” … /></p>

Both in XHTML 1.0 Strict. Both validate. However, both are a different approach and i’m curious to get opinions on the subject…

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 28.2005 — <i>
</i>[i]explicitly associate label with form element 'test':[/i]
&lt;label for="test"&gt;Test: &lt;/label&gt;&lt;input id="test" type="text" /&gt;

[i]implicitly associate label with form element 'test':[/i]
&lt;label&gt;Test: &lt;input id="test" type="text" /&gt;&lt;/label&gt;


See http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1 for more info.
Copy linkTweet thisAlerts:
@DanDigiManauthorJan 28.2005 — Exactly what I wanted! Thanks!
Copy linkTweet thisAlerts:
@FangJan 28.2005 — In IE implicit labels do not pass the focus!
×

Success!

Help @DanDigiMan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...