Reputation: 2103
How can I make a form label activate (focus) the form field it coincides with?
Upvotes: 0
Views: 342
Reputation: 19601
use the for
attribute on the label. It references the id
attribute of the form input/field you want it to focus.
eg. <input type="text" id="txt1" /><label for="txt1">Text 1</label>
Upvotes: 3