--Choose One-- value="Bui-6ren">
gpt4 book ai didi

jquery - 如何在 Firefox 中刷新 (F5) 时重置为默认下拉列表选项?

转载 作者:行者123 更新时间:2023-12-03 22:00:19 26 4
gpt4 key购买 nike

我在 Firefox 中有一个 ddl,它没有重置为默认标题。我该怎么做呢?这就是我到目前为止所拥有的。

<%string ddlVal = ""%>
<select id="detailSelect" name="DetailSelect">
<option <%if (ddlVal == "") { Response.Write("selected = &quot;selected&quot;"); } %> value="" >--Choose One--</option>
<option <%if (ddlVal == "Building") { Response.Write("selected = &quot;selected&quot;"); } %> value="Building">Building</option>
<option <%if (ddlVal == "Contents") { Response.Write("selected = &quot;selected&quot;"); } %> value="Contents">Contents</option>
</select>

刷新时,ddl 是刷新之前显示的内容,而不是默认的 ddl。我该如何纠正这个问题?

最佳答案

添加autocomplete="off"<select>标签。这是 Firefox 记住您的下拉选择的一个已知问题。

关于jquery - 如何在 Firefox 中刷新 (F5) 时重置为默认下拉列表选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3858359/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com