Sounds like a bit of a silly question, but I am wondering what is the best way of stating that a checkbox is checked/unchecked in HTML.
I have seen many different examples:
<input type="checkbox" checked="checked" />
<input type="checkbox" />
<input type="checkbox" checked="yes" />
<input type="checkbox" checked="no" />
<input type="checkbox" checked="true" />
<input type="checkbox" checked="false" />
Which browsers work with which ones of these, and most importantly, does jQuery figure out which box is checked in all 3?
Edit:
The W3C spec seems to imply that just the checked attr being there is correct. Does that mean that checked="false" and checked="no" will still check the box though?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…