What is wrong with this checkbox controller?
JQuery will change the attribute in html, but not the graphic checkbox ...
HTML
<input type="checkbox" checked="checked"/> <input type="checkbox"/> <a href="#" class="no">off</a> <a href="#" class="yes">on</a>
Js
$(document).ready(function(){ $('.yes').click(function(){ $('input:checkbox').attr('checked','checked'); }); $('.no').click(function(){ $('input:checkbox').removeAttr('checked'); }); })
test
http://jsfiddle.net/ehijon/Jmn3r/
source share