我是学习HTMl编码的新手,我想通过生成https://www.google.com/页面来训练自己。因此,我添加了一些输入,让用户进行is研究。
我想提供两种不同类型的重排(就像在Google的页面中一样)。在第一个例子中,通过点击"Google Search“提交输入,用户正在做一个经典的研究。而在第二个链接中,当用户点击"I'm when“提交输入时,用户会被直接带到第一个链接,如果用户做了一个经典的研究,就会出现第一个链接。
但问题是,这两个提交的输入都给了我一个“经典的研究”,在这个论坛和其他论坛上寻找了许多答案后,我仍然不明白为什么我的html代码不能工作。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Google</title>
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" type="image/x-icon" href="google_logo.png">
</head>
<body>
<div class="ends">
<a id="left" href="ggimage.html">Google image</a>
<a id="right" href="ggladvanced_search.html">Google advanced search</a>
</div>
<br><br><br><br><br><br><br><br>
<div>
<img src="google_search.PNG" alt="Google Search">
<form action="https://google.com/search">
<input type="text" name="q" placeholder="Enter your research">
<div>
<input id="right" name="btnK" type="submit" value="Google Search">
<p style="width: 10px;"></p>
<input id="left" name="btnI" type="submit" value="I'm Feeling Lucky">
</div>
</form>
</div>
</body>
</html>我尝试使用按钮而不是提交输入,但它显示了相同的结果。
发布于 2020-10-24 03:47:05
问题是您没有打开<input type="text"...>标记。关闭它,您的表单应该会按预期工作。
更改此设置:<input type="text" name="q" placeholder="Enter your reshearch">
关于这个:<input type="text" name="q" placeholder="Enter your research"/>
https://stackoverflow.com/questions/64506270
复制相似问题