【问题标题】:How do create a YouTube search form and buttom?如何创建 YouTube 搜索表单和按钮?
【发布时间】:2021-03-26 15:21:31
【问题描述】:

新手学习者在这里学习 HTML!表单的前两个按钮有效(Google 和 Bing),但是当我点击尝试尝试在 YouTube 上搜索相同的东西时,点击提交按钮后没有任何反应。有什么线索吗?我也尝试将操作链接更改为

https://www.youtube.com/results?search_query

但同样的问题也会发生。

这是我的代码:

<p>
    <!-- this form searched Google again with q query and name -->
<form action="https://www.google.com/search?q=">
    <input type="text" name="q">
    <button> Search Google here </button>
</form>
</p>

<p>
    <!-- this form searched Bing again with q query and name -->
<form action="https://www.bing.com/search?q=">
    <input type="text" name="q">
    <button> Search Bing here </button>
</form>
</p>

<p>
    <!-- this form searched Youtube again with q query and name -->
<form action="hhttps://www.youtube.com/results">
    <input type="text" name="search_query">
    <button> Search YouTube here </button>
</form>
</p>

【问题讨论】:

  • 您是否注意到在您的 Youtube 表单的 action 属性中您有 hhttps(而不是 https)?我测试了,这就是错误。

标签: html forms button youtube


【解决方案1】:

在您的 YouTube 表单中,您有 action="hhttps://www.youtube.com/results"hhttps 不是有效的 URI 协议,因此可以防止任何事情发生。将其更改为 https 即可开始正常工作。

【讨论】:

    猜你喜欢
    • 2020-02-27
    • 1970-01-01
    • 1970-01-01
    • 2013-12-16
    • 1970-01-01
    • 2016-05-22
    • 2021-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多