Firefox 忽略选项 selected="selected" [英] Firefox ignores option selected="selected"
问题描述
如果您更改下拉列表并刷新页面,Firefox 似乎忽略了 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.
有没有办法让 Firefox 停止这种行为(除了在页面加载时触发另一个事件)?
Is there a way to make firefox stop this behavior (other than firing another event when the page loads)?
推荐答案
AFAIK,此行为已硬编码到 Firefox 中.
AFAIK, this behaviour is hard-coded into Firefox.
您可以尝试在页面加载时将每个表单元素设置为其 defaultValue
.
You could try setting each form element to its defaultValue
on page load.
这篇关于Firefox 忽略选项 selected="selected"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!