Link to activate form field
How can I make a form label act开发者_JAVA百科ivate (focus) the form field it coincides with?
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>
精彩评论