JSFiddle - React, Tailwind, and code Playground
HTML
<input class="blah" name="abc" type="checkbox" id="blah1" />
<input class="blah" name="abc" type="checkbox" id="blah2" />
<input class="blah" name="abc" type="checkbox" id="blah3" />
<input class="blah" name="abc" type="checkbox" id="blah4" />
<input class="blah" name="abc1" type="checkbox" id="blah5" />
<input class="blah" name="abc1" type="checkbox" id="blah6" />
JavaScript
(function($){
if (typeof $.fn.prop !== 'function')
$.fn.prop = function(name, value){
if (typeof value === 'undefined') {
return this.attr(name);
} else {
return this.attr(name, value);
}
};
})(jQuery);
alert($('.blah').attr('checked', true));
alert('checked?');
alert($('.blah').attr('checked', false));
alert('unchecked?');
alert($('.blah').prop('checked', true));
alert('checked?');
alert($('.blah').prop('checked', false));
alert('unchecked?');
alert($('.blah').attr('name'));
alert($('.blah').prop('name'));