首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的输入(type=text)会自动在URL中显示#

为什么我的输入(type=text)会自动在URL中显示#
EN

Stack Overflow用户
提问于 2017-06-20 03:27:14
回答 1查看 190关注 0票数 1

我有以下代码:

代码语言:javascript
复制
<div class="container text-center">
          <h1 class="display-3">What's the weather</h1>
          <p class="lead"><strong>Enter the name of a city:</strong></p>
        <form>

<input type="text" placeholder="E.g. Cape Town, London" name="city" id="city" class="form-control" value="">

          <p class="lead">
            <button type="submit" class="btn btn-primary btn-lg" id="button">Submit</button>
          </p>
        </form>
    </div>

每当我单击“提交”按钮时,我都会得到值,然后是"#“。我不知道它是从哪里来的。它显示在URL (即GET变量)中。我正在使用bootstrap。我怎样才能去掉"#"?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-20 03:29:59

usu method="“action="”。方法POST或GET

代码语言:javascript
复制
<form method="GET" action="">
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44638431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档