The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Triggering focus with labels?

  • # September 10, 2013 at 6:18 pm

    This seems like an extremely simple question, but perhaps I misunderstand the functionality of <label>‘s.

    I have a set up similar to this:

    <label class="contact-labels" for="first-name">First Name</label>
    <span class="wpcf7-form-control-wrap first-name"><input type="text" name="first-name" value="" size="40" class="first-name" aria-required="true"></span>

    From what I understand, when you click on a label, focus jumps to the corresponding input field, however, with what I have above, that doesn’t happen.

    Is there something I’m missing?

    Any advice is appreciated,


    # September 10, 2013 at 6:32 pm

    You need an id="first-name"

    # September 10, 2013 at 7:37 pm

    Thank you!!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed