JavaScript可以取到<a class="as">超链接的颜色吗? RT 想用JavaScript得到我的链接的颜色可以吗?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ? 好象难取道CSS中的颜色哦,关注 <style>a.as{color:red}</style><a class="as" id=as>as</a><script language="javascript"><!--alert(document.getElementById("as").currentStyle.color)//--></script> <style>a.as{color:red}</style><a class="as" id=as>as</a><script language="javascript"><!--var CurrentStyle = function(element){ return element.currentStyle || document.defaultView.getComputedStyle(element, null);}alert(CurrentStyle(document.getElementById("as")).color)//--></script> if(document.getElementById("aaa").currentStyle){ alert(document.getElementById("aaa").currentStyle.backgroundColor); }else{ alert(document.defaultView.getComputedStyle(document.getElementById("aaa"),null).backgroundColor); } 怎样将某个文本框中的空值不发送到后台 拜个年,虎年吉祥好远连连 模拟实现fixed效果 请教2个问题 新手提问,关于鼠标事件执行顺序的问题 各位老师帮帮忙,怎么动态去添加图片的显示完整图片的链接 请教一下:对select的javascript代码!!!简单问题。 如何在IE6 SP1下resizeto 一个 fullscreen=1的页面 如何在文本框输入时屏蔽一些键? 多行表单验证 动态创建img元素的时候如何用onclick 请教一下,怎么样在函数里面写页面元素的鼠标事件
<style>
a.as{color:red}
</style>
<a class="as" id=as>as</a>
<script language="javascript">
<!--
alert(document.getElementById("as").currentStyle.color)//-->
</script>
a.as{color:red}
</style>
<a class="as" id=as>as</a>
<script language="javascript">
<!--
var CurrentStyle = function(element){
return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}
alert(CurrentStyle(document.getElementById("as")).color)//-->
</script>
alert(document.getElementById("aaa").currentStyle.backgroundColor);
}else{
alert(document.defaultView.getComputedStyle(document.getElementById("aaa"),null).backgroundColor);
}