我想知道如何在HTML页面的输入按钮上放置链接。到目前为止,我正在尝试通过在按钮周围放置超链接来在输入按钮上建立链接,但是是否可以使用任何其他方法导航到另一页?
现在我正在这样做:
<html>
<head>
<title>Practise 20</title>
<style>
input[type="submit"]{border:none; background:#000; color:#fff}
</style>
<body>
Click on Button to navigate the Pages
<form>
<a href="http://www.google.com" target="self"><input type="submit" Value="Go"></a>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
您可以通过Java脚本在输入按钮上放置链接。
<html>
<head>
<title>Practise 20</title>
<style>
input[type="submit"]{border:none; background:#000; color:#fff}
</style>
</head>
<body>
Click on Button to navigate the Pages
<form>
<input onClick="window.location.href='put your page url here'" type="submit" Value="Go">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
51935 次 |
| 最近记录: |