Reputation: 95
I have a checkbox and right next to that is image. I want be able to click on image to check the checkbox. I found out it can be done by wrapping the image and checkbox with label tag.
However, I need to position the checkbox somewhere else than it is by default. Don't you know how to do that?
Upvotes: 1
Views: 60
Reputation: 5070
Use label for
.
Your checkbox.
<input id="checkbox1" name="checkbox1" type="checkbox">
And then put the image wherever you need to:
<label for="checkbox1"><img src="your image path" /></label>
Upvotes: 1