>对标签的行内样式进行操作
对行内式的修改方法
<div id="box" style="width:100px;color:black;background-color:yellow;">111</div>
<script>
console.log(box.style.width)
console.log(box.style["background-color"])
console.log(box.style.backgroundColor)//此处两种方法访问background-color (把横线换为驼峰式)
修改样式值
box.style.width="2000px"
对内部样式,外部样式,行内样式都修改的方法(只能读,不能修改)
getComputeStyle()方法
var xbox=document.getElementById("box")
var res=getComputeStyle(xbox)
getComputeStyle(xbox).width
//通过id获得节点,然后再让节点作为参数给getComputeStyle()方法