Created
April 17, 2012 10:28
-
-
Save salieridk/2405143 to your computer and use it in GitHub Desktop.
Javascript: check checkbox by clicking text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//makes it possible to check checkbox by clicking the associated text. | |
$('.checkboxes').click(function(event) { | |
if (event.target.type !== 'checkbox') { | |
$(':checkbox', this).trigger('click'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment