html 跳转或打开新网页
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
</head>
<body>
<button onclick="location_web()">跳转网页</button>
<button onclick="open_web()">打开新网页</button>
<script>
function location_web() {
window.location = "https://www.baidu.com";
}
function open_web() {
window.open("https://www.baidu.com");
}
</script>
</body>
</html>