1)操纵标签style属性
基本语法
功能
示例
给<div>标签添加样式var obj1 = document.getElementById("div1");obj1.style.width = "1000px";obj1.style.height = "120px";obj1.style.backgroundColor = "orange";obj1.style.width = "1000px"; 给div添加宽度为1000像素obj1.style.height = "120px"; 给div添加高度为120像素obj1.style.backgroundColor = "orange"; 给div添加背景色为桔色
2)操纵标签class属性
基本语法
功能
示例
给<div>标签添加样式名           
  var obj1 = document.getElementById("div1");
  obj1.className = "div1"; 
  obj1.className = "div1";   给div 添加样式名为div1
3)this关键字
基本语法
this.className = 类名;
this.style.样式名 = 值;
功能
示例
给div标签添加click事件           
  obj1.onclick = function(){
    this.className = "div1";
    this.style.color = "white";
  }
    obj1.onclick = function()  元素对象添加点击事件
    this.className = "div1";  给当前元素添加类名为div1
    this.style.color = "white";  给当前元素添加文本颜色样式为白色
