获取href连接:

<!DOCTYPE html>  
<html>  
<head>  
<script src="/jquery/jquery-1.11.1.min.js"></script>  
<script>  
$(document).ready(function(){  
  $("button").click(function(){  
    alert($("#w3s").attr("href"));  
  });  
});  
</script>  
</head>  
  
<body>  
<p><a href="http://www.w3school.com.cn" >W3School.com.cn</a></p>  
<button>显示 href 值</button>  
</body>  
  
</html>  

 

跳转:

1.在原来的窗体中直接跳转用  
  
window.location.href="你所要跳转的页面";  
  
2、在新窗体中打开页面用:  
  
window.open('你所要跳转的页面');  
  
window.history.back(-1);返回上一页  

  

 

相关文章:

  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-07-29
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-02-27
相关资源
相似解决方案