html - 是否可以在 FORM post/get 中添加 anchor ?

标签 html forms input submit

我注意到在 Firefox 中我可以将 #MyAnchor 标记添加到 action 属性中,例如...

<form action="#MyAnchor">
   <input type="text" name="a" />
   <input type="text" name="b" />
   <input type="submit" />
</form>

提交表单时, anchor 会自动显示在 URL 中,如下所示

mypage.aspx?a=1&b=2#MyAnchor

但是,这在 IE 上不起作用。无论如何,我可以找到适合两种浏览器的媒介吗?

最佳答案

只是猜测,但您是否尝试过使用页面 + anchor 名称。

<form action="mypage.aspx#MyAnchor">

关于html - 是否可以在 FORM post/get 中添加 anchor ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/693545/

相关文章:

jquery - 单选按钮 - 使用 jQuery 显示基于选中按钮的 DIV

reactjs - 延迟一个字符更新状态

HTML 输入标签语法

javascript - 如何为 document.activeElement 设置文本值?

c - 跳过某些字符

html - 如何在html中并排放置2张图片?

php - 电子邮件未发送 mdaemon 配置完成但邮件未发送通过且未收到错误 php 文件

javascript - 如何更改列表中单击某些元素的内容?

jquery - 从外部文件收集 JSON 数据

php - 使用 PHP 将表单数据发送/发布到 URL