<div id="txt" style="color:red;font-size:100px;float:left"><div>
<script>
window.onload=function(){
var test=document.querySelect("#txt");
//获取字体,需用驼峰式写法
test.style.fontSize
//获取float值
test.style.cssFloat; //非IE
test.style.styleFloat; //IE
text.style.color='#ff00ff';
//获取所有行内样式属性及值
test.style.cssText;
//设置属性(方法2)
test.style.setProperty('color':'blue'); //IE9及以下不支持
//删除属性
test.style.removeProperty('color':'blue'); //IE9及以下不支持
}
</script>