zoukankan      html  css  js  c++  java
  • 属性定义

     1 <!DOCTYPE html>
     2 <html>
     3     <head>
     4         <meta charset="UTF-8">
     5         <title></title>
     6     </head>
     7     <body>
     8         window.onload=function(){
     9     var _oDiv=document.getElementById('oDiv');
    10     //_oDiv.index=0;
    11     //alert(_oDiv.index)
    12     //alert(_oDiv.b)
    13     
    14     //两种方法不能通用
    15     
    16     //_oDiv.setAttribute('a','a1');//属性名,属性值;设置
    17     //alert(_oDiv.getAttribute('a'))//获取
    18     //alert(_oDiv.getAttribute('b'))
    19     //alert(_oDiv.getAttribute('index'))
    20     
    21     _oDiv.setAttribute('style','color:red');
    22     
    23     _oDiv.removeAttribute('style');//删除
    24     
    25 }
    26     </body>
    27 </html>
  • 相关阅读:
    poj 2388
    BUAA 1489
    poj 2524
    poj 2109
    poj 2503 Babelfish
    poj All in All
    poj 1611 The Suspects
    poj 2299
    poj 1328
    hdu 1008 Elevator
  • 原文地址:https://www.cnblogs.com/thestudy/p/6292181.html
Copyright © 2011-2022 走看看