Reset checkbox checked state go back from history

后端 未结 4 544
余生分开走
余生分开走 2021-01-13 01:15

In the following example, I use checkbox for making a pure CSS dropdown navigation, also available in this jsFiddle example.

Open that fiddle, click

4条回答
  •  孤独总比滥情好
    2021-01-13 01:34

    No need for JS or CSS, just add autocomplete="off" to the checkbox. This will prevent the browser from caching the 'checked' status.

    Example: https://jsfiddle.net/6g5u8wkb/

    Also, if you have multiple checkboxes, I beleive you can add autocomplete="off" to the form element to apply the effect to all inputs fields.

提交回复
热议问题