1.通过window.open函数
<div onclick="window.open(*http://www.baidu.com*)">在新窗口跳转至百度</div>
<div onclick="window.open(*http://www.baidu.com*,*_self*)">在当前窗口跳转至百度</div>
2.通过window.location.href函数
<div onclick="window.location.href= *http://www.baidu.com*;return false">在当前窗口跳转至百度</div>

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2021-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案