Is there a way to tell Firefox not to remember the state of my input fields on page refresh?

后端 未结 4 1621
逝去的感伤
逝去的感伤 2021-02-07 00:21

Firefox has a very annoying feature. It remembers the state of input fields when you hit F5. It\'s not just the value, it remembers even whether the input is disabled or not.

4条回答
  •  借酒劲吻你
    2021-02-07 00:51

    I do think all browsers have that feature.

    But to reset your input to its original value, try this.

    $('document').ready(function(){//or whenever you want to fire back to the default value
        $('input#withanidplease').val($('input#withanidplease').prop('defaultValue'))
    })
    

提交回复
热议问题