Search code examples
firefoxdrop-down-menurefresh

Firefox ignores option selected="selected"


If you change a dropdown and refresh the page, Firefox seems to ignore the selected attribute.

<option selected="selected" value="Test">Test</option>

It will in fact select the option you had previously selected (before the refresh). This ends up being a problem for me since there is an event triggered on the dropdown which changes other things.

Is there a way to make firefox stop this behavior (other than firing another event when the page loads)?


Solution

  • AFAIK, this behaviour is hard-coded into Firefox.

    You could try setting each form element to its defaultValue on page load.