Question: I've found what I believe to be a bug with Firefox and I'm wondering if this actually is a bug, as well as any workarounds for this.

If you create a basic webpage with the following source:

```
<html>
  <head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
  </head>
  <body>
    <div>
      <input id="txtTest" type="text" />
      <input type="button" onclick="$('#txtTest').attr('disabled','disabled');" value="Set Disabled (jQuery)" />
      <input type="button" onclick="document.getElementById('txtTest').disabled = true;" value="Set Disabled (js)" />
      <input type="button" onclick="$('#txtTest').removeAttr('disabled');" value="Remove Disabled" />
    </div>
  </body>
</html>

```

If you `disable` the `textbox` dynamically and then refresh the page, the `textbox` will remain disabled instead of resetting back to its original state of not disabled. I've tried this in IE8 and Chrome and those behave as I would expect, resetting the `textbox` back to not disabled when I refresh.

Another interesting bit of information is that it still does the same thing if the input is a `checkbox` instead of a `textbox`.

Answer: 
To deal with the back button, do this (from [here](https://bugzilla.mozilla.org/show_bug.cgi?id=443289))

```
    window.addEventListener('pageshow', PageShowHandler, false);
    window.addEventListener('unload', UnloadHandler, false);

    function PageShowHandler() {
        window.addEventListener('unload', UnloadHandler, false);
    }

    function UnloadHandler() {
        //enable button here
        window.removeEventListener('unload', UnloadHandler, false);
    }

```
This is indeed an open [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=654072) in Firefox. There is also a note in [MDN: `autocomplete`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#Values) (scroll down to the second yellow box):

> 
> Note: The `autocomplete` attribute also controls whether Firefox will — unlike other browsers — [persist the dynamic disabled state and (if applicable) dynamic checkedness](https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing) of an `<input>` element, `<textarea>` element, or entire `<form>` across page loads. The persistence feature is enabled by default. **Setting the value of the `autocomplete` attribute to `off`** disables this feature. This works even when the autocomplete attribute would normally not apply by virtue of its type. See [bug 654072](https://bugzilla.mozilla.org/show_bug.cgi?id=654072).
> 
> 
> 

If you are using Bootstrap, you might be interested in the

* [comment on the bug report by a Bootstrap team member](https://bugzilla.mozilla.org/show_bug.cgi?id=654072#c30)
* [bug report in the Bootstrap repository](https://github.com/twbs/bootstrap/issues/793)
* [note in the Bootstrap documentation](https://getbootstrap.com/docs/3.4/javascript/#buttons)