<HTML><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Select all, reverse, select all</title><Head></Head><Scripttype= "Text/javascript"src= "Jquery-1.4.3.js"></Script><Scripttype= "Text/javascript"> $(function(){ $("#CheckedAll"). Click (function(){ $("#playList: CheckBox"). attr ("checked",true); }); $("#unSelect"). Click (function(){ $("#playList: CheckBox"). attr ("checked",false); }); $("#reverse"). Click (function(){ $("#playList: CheckBox"). each (function(){ $( This). attr ("checked",!$( This). attr ("checked")); }) }); $("#send"). Click (function(){ varStr= "your chosen hobby: \ r \ n"; $('input[type=checkbox][name=items]:checked'). each (function() {str+=$( This). Val ()+'\ r \ n'; }); alert (str); }); });</Script><Body> <form>What's your favorite sport? <BR/><inputtype= "button"ID= "Checkedall"value= "Select All"/><BR/> <inputtype= "button"ID= "Unselect"value= "All is not selected"/><BR/> <inputtype= "button"ID= "Reverse"value= "Reverse Selection"/><BR/> <DivID= "PlayList"> <inputtype= "checkbox"name= "Items"value= "Football"/>Football<inputtype= "checkbox"name= "Items"value= "Basketball"/>Basketball<inputtype= "checkbox"name= "Items"value= "Badminton"/>Badminton<inputtype= "checkbox"name= "Items"value= "Table tennis"/>Table tennis<BR/> <inputtype= "button"ID= "Send"value= "Submit"/> </Div></form> </Body></HTML>