小熊泡泡

常用链接

统计

最新评论

如何取到css里selected的属性值

<style type="text/css">
 #test {
  height: 200px;
  width: 200px;
  background-color:red;
 }
</style>

<script>
 window.onload = function(){
  var div = document.getElementById("test");
  var s = div.currentStyle || window.getComputedStyle(div,'') || document.defaultView.getComputedStyle(div, '');
  var p = s.width || s.getPropertyValue("width");
  alert(p);
</script>

posted on 2006-07-07 15:18 小熊泡泡 阅读(2404) 评论(1)  编辑  收藏 所属分类: html-css

评论

# re: 如何取到css里selected的属性值 2013-05-07 13:45 萨提亚

谢谢哦  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: