Reputation: 35760
<input type="checkbox" />
<label>I agree</label>
Now when I click "I agree", nothing happens, I'd like to make the checkbox checked
, what's the easiest way to do this?
Upvotes: 5
Views: 4834
Reputation: 12051
As an alternative to what @stevether suggested, you can also wrap the label around the checkbox
<label><input type="checkbox" /> I agree</label>
Upvotes: 4
Reputation: 13822
for
and id
attributes
<input id="thisinput" type="checkbox" />
<label for="thisinput">I agree</label>
Upvotes: 10