<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CheckAll-UncheckAll</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#checkAll").toggle(
function () {
$('input:checkbox,input:radio').attr('checked',true);
},
function () {
$('input:checkbox,input:radio').attr('checked',false);
}
);
$('#DE').toggle(
function () {
$('input:checkbox,input:radio,input:submit,input:reset,input:button').attr('disabled','disabled');
$('input:text').attr('disabled','disabled');
},
function () {
$('input:checkbox,input:radio,input:submit,input:reset,input:button').removeAttr('disabled');
$('input:text').removeAttr('disabled');
}
);
});
</script>
</head>
<body>
<button id="checkAll">Check/Uncheck All</button>
<button id="DE">Disable/Enable</button>
</br>
<p>
<input type="checkbox" /> Checkbox 1
<input type="radio" value="1" />Radio 1
TextField 1<input name="" type="text" />
<label for="textarea"></label>
<input type="submit" name="button" id="button" value="Submit" />
</p>
<p>
<input type="checkbox" /> Checkbox 2
<input type="radio" value="2" />Radio 2
TextField 2<input name="" type="text" />
<input type="reset" name="button2" id="button2" value="Reset" />
</p>
<p>
<input type="checkbox" /> Checkbox 3
<input type="radio" value="3" />Radio 3
TextField 3<input name="" type="text" />
<input type="button" name="button3" id="button3" value="Button" />
</p>
</br>
</body>
</html>