如何取到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 小熊泡泡 閱讀(2430) 評論(1) 編輯 收藏 所屬分類: html-css