js替换html所有a连接文字
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js替换html所有a连接文字</title>
</head>
<body>
<script language="JavaScript">
window.onload = function(){
var objs = document.getElementsByTagName("a");
for(var i=0; i<objs.length; i++)if(objs[i].innerHTML == "最后在看看")objs[i].innerHTML = "可以了";
}
</script>
<a href="http://www.111cn.net">最后在看看</a>
</body>
</html>
时间: 2024-10-30 05:09:46