dw软件如何通过自己设置的按钮进行页面跳转!自己设置的按钮然后不会跳转了
2条回答 默认 最新
关注<!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>本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用