<!-- 示例代码:HTML按钮跳转网页 -->
<!DOCTYPE html>
<html>
<head>
<title>按钮跳转示例</title>
</head>
<body>
<!-- 创建一个按钮,点击后跳转到指定的网页 -->
<button onclick="window.location.href='https://www.example.com'">跳转到 Example 网页</button>
<!-- 解释说明:
1. 使用 <button> 标签创建一个按钮。
2. 通过 onclick 事件绑定 JavaScript 代码,当按钮被点击时触发。
3. window.location.href='https://www.example.com' 是 JavaScript 代码,用于将当前页面重定向到指定的 URL(本例中为 https://www.example.com)。
-->
</body>
</html>
上一篇:html footer
下一篇:免费html代码烟花特效
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站