Possible Duplicate:
.prop() vs .attr()
Please take a look at this fiddle:
$("#test").prop({
checked: true,
disabled: true
});
$("#result").text($("#container").html());
You will see the output is:
<input disabled="disabled" id="test" type="checkbox">
This is in FF 5. Why does it add an attribute for disabled and not for checked? I was hoping it would do both in a consistent way.
EDIT:
I realize now the result is completely different in every browser.
More Results:
IE6/7:
<INPUT id=test disabled type=checkbox CHECKED>
Chrome 13:
<input id="test" type="checkbox" disabled="">
IE8:
<INPUT id=test disabled type=checkbox>