dw软件如何通过自己设置的按钮进行页面跳转!自己设置的按钮然后不会跳转了
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<a href="https://www.baidu.com/">a标签超链接跳转</a>
<br>
<button onclick="window.location.href = 'https://www.baidu.com/'">直接window.location.href跳转</button>
<br>
<button onclick="gotoPath()">通过函数window.location.href跳转</button>
<script>
function gotoPath() {
window.location.href = "https://www.baidu.com/"
}
</script>
</body>
</html>
参考:https://www.xuewangzhan.net/dreamweaver/491.html