为什么这个js老说Element没定义?<html>
<head>
<style type="text/css">
.style1{
color:red;
}
.style2{
color:blue;
}
</style> </head> <body>
<form name="f">
<a href="#" id="tag1" class="style1" onclick="javascript:changeStyle('1');">Hello</a>
</form>
</body></html><script language="javascript">
function changeStyle(oid){
Element.removeClassName($('tag' + oid),"style1");
Element.addClassName($('tag' + oid),"style2");
}
</script>
<head>
<style type="text/css">
.style1{
color:red;
}
.style2{
color:blue;
}
</style> </head> <body>
<form name="f">
<a href="#" id="tag1" class="style1" onclick="javascript:changeStyle('1');">Hello</a>
</form>
</body></html><script language="javascript">
function changeStyle(oid){
Element.removeClassName($('tag' + oid),"style1");
Element.addClassName($('tag' + oid),"style2");
}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货