var dd = document.createElement("div");
   dd.id = "selectorArea";
   dd.width = 400 + "px";
   dd.height = 400 + "px";
   dd.style.backgroundColor = "Blue";   document.body.appendChild(dd);

解决方案 »

  1.   

    L@_@K
      var dd = document.createElement("div");
      dd.id = "selectorArea";
      dd.style.width = 400 + "px";
      dd.style.height = 400 + "px";
      dd.style.backgroundColor = "Blue";  document.body.appendChild(dd);
      

  2.   

    还可以这么写L@_@K
      var dd = document.createElement("div");
      dd.id = "selectorArea";
      with(dd.style) {
          width = 400 + "px";
          height = 400 + "px";
          backgroundColor = "Blue";
      }
      document.body.appendChild(dd);Web 开发常用手册DHTML 参考手册
    http://download.csdn.net/source/308913JScript 语言参考
    http://download.csdn.net/source/308916CCS 样式表中文手册
    http://download.csdn.net/source/304124