<script type="text/javascript">
$(function () {
var allBox = $(":checkbox");
allBox.click(function () {
allBox.removeAttr("checked");
$(this).attr("checked", "checked");
});
});
</script>
<div>
<input type="checkbox" value="1"/>
<input type="checkbox" value="2"/>
</div>
$(function () {
var allBox = $(":checkbox");
allBox.click(function () {
allBox.removeAttr("checked");
$(this).attr("checked", "checked");
});
});
</script>
<div>
<input type="checkbox" value="1"/>
<input type="checkbox" value="2"/>
</div>
var allBox = $(":checkbox");
allBox.click(function () {
if(this.checked){
allBox.removeAttr("checked");
$(this).attr("checked", "checked");
}
});
});
var allBox = $(":checkbox");
allBox.click(function () {
if(this.checked || this.checked=='checked'){
allBox.removeAttr("checked");
$(this).attr("checked", "checked");
}
});
});