Tag: Property object code length Select string Set attribute Log
Select/Cancel a set of check boxes
/* * * Select/Cancel a set of check boxes * @param checkallid all Checkboxid * @param objname */function Selectgroup (checkallid,objname) { $ (' input[name= ' +objname+ ') '). Prop (' Checked ', $ ("#" +checkallid). Prop (' Checked ')); }
Gets the value of a selected set of check boxes
function Getcheckedval (checkboxname) { var checkedvals = ""; $ ("input[name=" +checkboxname+ "]:checked"). each (function() { = checkedvals + $ (This ). Val () + ","; }); if (Checkedvals! = "") {// Remove the last one "," checkedvals = checkedvals.substring (0 , Checkedvals.length-1) } return checkedvals;}
Knowledge Expansion:
Prop (NAME|PROPERTIES|KEY,VALUE|FN) returns the JQuery object
Gets the property value of the first element in a matching element set or sets one or more properties for each matching element.
attr (NAME|PROPERTIES|KEY,VALUE|FN) returns string
Gets the value of the property that matches the first element of the element collection or sets one or more properties for each matching element.
jquery Control checkbox