javascript和jquery修改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");