在js中创建一个div,以及对div的一些操作。

 
  
  1. var   bottomer=document.createElement("div");//创建一个div对象(背景层)          
  2.     //定义div属性     
  3.     bottomer.setAttribute("id","btDiv");    
  4.     bottomer.style.position="absolute";     
  5.        
  6.     bottomer.style.background="#777";     
  7.     bottomer.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";     
  8.     bottomer.style.opacity="0.6";    
  9.        
  10.     bottomer.style.top = "96%";  
  11.     bottomer.style.padding = "10px";  
  12.     bottomer.style.width="100%";     
  13.     bottomer.style.height="100%";     
  14.     bottomer.style.zIndex   =  "10000";     
  15.     bottomer.style.backgroundImage = "url(p_w_picpath/login.jpg)";  
  16.     bottomer.innerHTML = "台电科技";  
  17.     bottomer.style.fontSize = "15px";  
  18.     bottomer.style.textAlign = "left";  
  19.     document.body.appendChild(bottomer);//在body内添加该div对象