Read the latest web development and design tips at Fred Wu's new blog! :-)
Poke me on GitHub

Posts Tagged ‘html’

Option selected=”selected” not working?

If you ever have an HTML select that doesn’t want to default to the option you’ve added selected=”selected” to, it may not be a problem in your code. It may be due to Firefox’s behaviour.

Firefox seems to always default to the option selected by a user instead of the option that has the selected=”selected” tag – even on a page refresh (without even first POSTing the data)! Copy and paste the URL into another browser tab/window and it’ll most likely work fine… :)

Internet Explorer doesn’t have this problem (surprisingly).

Related posts