#tech {
position: absolute;
border: 2px solid blue;
width: 30px;
height: 30px;
top: 50px;
}
<div id='tech'></div>
我是用的getComputedStyle(document.getElementById('tech'), null).top来取的top的值,但是这个好像是只读的,如果我要修改的话,应该怎么改?用document.getElementById('tech').top好像不行。CSSJavaScript
position: absolute;
border: 2px solid blue;
width: 30px;
height: 30px;
top: 50px;
}
<div id='tech'></div>
我是用的getComputedStyle(document.getElementById('tech'), null).top来取的top的值,但是这个好像是只读的,如果我要修改的话,应该怎么改?用document.getElementById('tech').top好像不行。CSSJavaScript
解决方案 »
- 添加一个按钮怎么样让Ext.ux.grid.RowExpander有全部展开和收缩的功能
- js 如何判断数组为空
- 来帮忙看看代码,JavaScript向SQL2005插入数据
- jquery1.2.6版本让event.layerX无法使用的问题
- VISTA+IE7上弹出脚本错误的提示
- 怎样去掉字符串里重复的
- Javascript 读写文件IE总会跳一个对话框提示不安全 怎么关掉这个? (不要修改任何用户设置)
- 点右键出现菜单,选择性屏蔽掉某个选项。怎么做?100分!!!!
- 请问如何在JAVASCRIPT中使用ASP中的变量
- 当窗口失去焦点时,就把窗口关闭,如何做??
- 求解释一段js代码,一直无法想明白marquee函数里 是啥意思
- dwr加载问题
<style>
.a{
position: absolute;
border: 2px solid blue;
width: 30px;
height: 30px;
top: 50px;
}
</style>
<div id='tech' class="a"></div>
<script type="text/javascript">
var d=document.getElementById('tech');
d.style.top='500px';
</script>
document.getEelementById("").class="class1";
or
document.getEelementById("").class="class2";
or
document.getEelementById("").className="class2";
上面给错了