Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 html 中生成一个表单,允许将输入的文本发送到地址栏?
当然,您只需确保表单 METHOD 设置为 GET:
<form id="myForm" method="GET"> //Form Stuff </form>
在这里查看更多信息
没有任何测试并且没有想到,这应该可以解决问题(混乱):
<form onsubmit="window.location = document.getElementById('addressfield').value; return false;"> <input type="text" id="addressfield" /> </form>