JavaScript中,某标签设置position属性,获取/修改其top、left值
str.value.top=a;
str.value.left=b;
//str表示设置了position属性的元素
经测试:
ie中可以正常更新位置,Chrome中不行
测试代码:
position的top、left
<script type="text/javascript">
function change(){
document.getElementById("a").style.top=200;
document.getElementById("a").style.left=200;
}
</script>
测试文本