What is the proper way to check and uncheck a checkbox in HTML5?

后端 未结 8 2269
小蘑菇
小蘑菇 2020-12-15 02:09

Looked at the HTML spec, but couldn\'t make heads or tails of it: http://www.w3.org/TR/html5/the-input-element.html#attr-input-checked

What is the correct way to che

相关标签:
8条回答
  • 2020-12-15 03:03

    you can use autocomplete="off" on parent form, so if you reload your page, checkboxes will not be checked automatically

    0 讨论(0)
  • 2020-12-15 03:13

    You can refer to this page at w3schools but basically you could use any of:

    <input checked>
    <input checked="checked">
    <input checked="">
    
    0 讨论(0)
提交回复
热议问题