html - label not working with checkbox -



html - label not working with checkbox -

ok, missing? have:

<form> <input type="checkbox" name="showratings" value="1" checked> <label for="showratings">show ratings</label> </form>

and when click on "show ratings" text, checkbox not toggling. know it's simple.

i believe label element links id attribute, not name attribute. seek this:

<form> <input type="checkbox" name="showratings" id="showratings" value="1" checked> <label for="showratings">show ratings</label> </form>

reference here.

html

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -