属性、样式、offset的读写
属性读写:
第一种:打点
第二种:setAttribute/getAttribute()
样式
行内样式读写
元素.style.属性=“属性值”;
非行内样式读写
读:getComputedStyle(目标元素,false,[‘属性’])
写:元素.style.属性="属性值";
offset
读:元素.offsetWidth/offsetHeight/offsetLeft/offsetTop
读取数据返回值全部为数字,读取到的值修改时要 +“px”
写:元素.style.width/height