zoukankan      html  css  js  c++  java
  • 打印Dom对象的所有属性和方法

    <html>
    <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    
    <script language="javascript">
    
    for(myprop in document)
        {
          
        
            if (typeof(document[myprop])=="function"){
            
            
            document.writeln("属性名称:"+myprop+";属性值:"+document[myprop]+"<br>");
            document.writeln(typeof(document[myprop]));
            }
            
            
            /* document.writeln("Document的所有属性:");
            if (typeof(document[myprop])!="function"){
            
            
            document.writeln("属性名称:"+myprop+";属性值:"+document[myprop]+"<br>");
            //document.writeln(typeof(document[myprop]));
            } */
        }
    </script>
    </head>
    <body>
        <p onClick="func();">Menu Bar</p>
        
        <p name="a" style="display:none">item1</p>
        <p name="a" style="display:none">item2</p>
    </body>
    </html>
  • 相关阅读:
    iOS~runtime理解上篇
    iOS
    iOS-数据库+上传队列+runtime
    python3
    必应壁纸破解下载
    python3-django Mac下安装以及查看路径
    iOS
    iOS
    Tornado异步之-协程与回调
    iOS
  • 原文地址:https://www.cnblogs.com/hubing/p/3245829.html
Copyright © 2011-2022 走看看