1.a标签的href的修改
① javascript:
document.getElementById("myId").setAttribute("href","www.xxx.com");
document.getElementById("myId").href = "www.xxx.com";
②jquery:
$("#myId").attr("href","www.xxx.com");
① javascript:
document.getElementById("myId").setAttribute("href","www.xxx.com");
document.getElementById("myId").href = "www.xxx.com";
②jquery:
$("#myId").attr("href","www.xxx.com");
本文标题:标签在JS与Jquery中的使用
本文链接:https://www.haomeiwen.com/subject/mqftpxtx.html
网友评论