Created
February 25, 2014 19:19
-
-
Save bensochar/9215688 to your computer and use it in GitHub Desktop.
Wrap Checkbox Inputs so you can style them.
This file contains hidden or 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
jQuery(document).ready(function($) { | |
$(':checkbox').wrapCheckboxInputs(); | |
}); | |
(function($) { | |
$.fn.wrapCheckboxInputs = function() { | |
return this.each(function () { | |
var _label = $(this).closest("label.checkbox"); | |
var _nme = this.name; | |
var _id = this.id; | |
$(this).wrap('<div class="box" data-id="'+_id+'"></div>').wrap('<div class="check" data-id="'+_id+'"></div>'); | |
}); | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment