/ Published in: JavaScript

Select all checkbox in the specific context.
Need jQuery Framework : http://jquery.com/
Need jQuery Framework : http://jquery.com/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// context = id of elements which contains checkboxes // controller = DOMelement of ckeckbox controller function checkall(context, controller){ $("#"+context).find("input[@type$='checkbox']").not(controller).each(function(){ // verify the state of checkbox controller and pass the state to others checkboxes this.checked = $(controller).checked; }); }
Comments
