dimanche 4 décembre 2016

a-tag within checkbox-label

I've got a link inside my label which contains a for-attribute for a checkbox input-element:

<li>
    <label for="tab2-btn">
        <a class="menu_link" href="#the-tab-bar">Payment</a>
    </label>
</li>

[...]

<div class="tabBar" id="the-tab-bar">
   <input type="radio" name="tab" id="tab2-btn">
[...]
</div>

The a-Tag links to the specific dom element as expected (jumps to div with id "the-tab-bar"), but the label won't work meaning that the checkbox with the id "tab2-btn" won't be checked.




Aucun commentaire:

Enregistrer un commentaire