<!DOCTYPE HTML>
<title>checked, defaultChecked and "checked"</title>
<script>
function a(b,c,d){
if(b === true)
b += " ";
if(c === true)
c += " ";
document.getElementsByTagName('pre')[0].firstChild.data += b + " " + c + " " + d + "\n\r"
}
</script>
<input type="checkbox" onmousedown="a(this.checked,this.defaultChecked,event.type)" onmouseup="a(this.checked,this.defaultChecked,event.type)" onclick="a(this.checked,this.defaultChecked,event.type)" checked="checked">
<pre>checked defaultChecked event
</pre>
<p><button onclick="document.getElementsByTagName('input')[0].setAttribute('checked','checked')">set "checked" attribute"</button>
<p><button onclick="document.getElementsByTagName('input')[0].removeAttribute('checked','checked')">remove "checked" attribute"</button>
<p><button onclick="document.getElementsByTagName('input')[0].checked = true">set "checked" DOM attribute"</button>
<p><button onclick="document.getElementsByTagName('input')[0].checked = false">remove "checked" DOM attribute"</button>