I have created a plugin that creates a check box image based based on a hidden field. I would like to override the is() function… is that possible? I’m basically using an image to mock a checkbox.
Html:
<input type="hidden" value="1" id="box" />
Create the plugin for the hidden field:
$('#box').myCheckbox();
I would like to be able to do the following:
$('#box').is(':checked');
Is it possible to override the is() function in my plugin?
yep 🙂
btw
:checkedis already supported by defaultso if u had
$(‘#checkbox’).is(‘:checked’);// return true/false depending if the checkbox is ticked or not don’t over complicate things as you will pull ur hair out later on when u forgot that u made this overriding changes 🙂