• 吴裕雄--天生自然 JAVASCRIPT开发学习:对象 实例(3)


    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    </head>
    <body>
    
    <a id="runoob" charset="ISO-8859-1" href="//www.runoob.com/">菜鸟教程</a><br>
    <script>
    document.write("返回链接的charset: ");
    document.write(document.getElementById('runoob').charset);
    document.write("<br><br>");
    </script>
    <a id="google" href="//www.google.com/">Google</a><br>
    <script>
    document.getElementById('google').charset="utf-8";
    document.write("设置链接的charset: ");
    document.write(document.getElementById('google').charset);
    </script>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head> 
    <meta charset="utf-8"> 
    <title>菜鸟教程(runoob.com)</title> 
    </head>
    <body>
    
    <p><a id="runoob" href="//www.runoob.com/">菜鸟教程</a></p>
    <script>
    document.write("返回 href 链接: ");
    document.write(document.getElementById('runoob').href);
    </script>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    </head>
    <body>
    
    <a id="runoob" hreflang="zh-cn" href="//www.runoob.com/">菜鸟教程</a><br>
    <script>
    document.write("返回链接的hreflang: ");
    document.write(document.getElementById('runoob').hreflang);
    document.write("<br><br>");
    </script>
    <a id="google" href="//www.google.com/">Google</a><br>
    <script>
    document.getElementById('google').hreflang="no";
    document.write("设置链接的hreflang: ");
    document.write(document.getElementById('google').hreflang);
    </script>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    </head>
    <body>
    
    <p><a href="#C6">参见第6章</a></p>
    <h2>第1章</h2>
    <p>这一章解释了 ba bla bla</p>
    <h2>第2章</h2>
    <p>这一章解释了 ba bla bla</p>
    <h2>第3章</h2>
    <p>这一章解释了 ba bla bla</p>
    <h2>第4章</h2>
    <p>这一章解释了 ba bla bla</p>
    <h2>第5章</h2>
    <p>这一章解释了 ba bla bla</p>
    <h2><a id="c6" name="C6">第6章</a></h2>
    <p>这一章解释了 ba bla bla</p>
    <script>
    document.write("返回锚: ");
    document.write(document.getElementById("c6").name);
    </script>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    </head>
    <body>
    
    <p><a id="func" rel="friend" href="//www.functravel.com/">优惠航班</a></p>
    <script>
    document.write("当前文档和链接的文档之间的关系: ");
    document.write(document.getElementById("func").rel);
    </script>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <script>
    function changeTarget(){
        document.getElementById('runoob').target="_blank";
    }
    </script>
    </head>
    
    <body>
    <a id="runoob" href="//www.runoob.com">访问菜鸟教程</a>
    <br><br>
    <input type="button" onclick="changeTarget()" value="修改target">
    <p>尝试在你单击按钮之前点击链接。</p>
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    </head>
    <body>
    
    <p><a id="runoob" type="text/html" href="//www.runoob.com">菜鸟教程</a></p>
    <script>
    document.write("返回链接的type属性值:");
    document.write(document.getElementById("runoob").type);
    </script>
    
    </body>
    </html>

  • 相关阅读:
    [svc]二三层数据格式&&三层数据如何匹配路由
    [na][dhcp]dhcp细枝末节&dhcp防攻
    [docker]使用quaaga实现(rip ospf)实现主机间容器互通
    [svc]centos7安装优化最佳姿势
    [svc]gns3模拟器及探讨几个bgp问题
    [svc]ip routing和no ip routing
    [docker]macvlan实现双vlan互通
    Jmeter 日志设置---如何设置java协议中被测jar的日志?
    Jmeter java协议配置文件导入
    eclipse, Log4j配置(真心的详细~)
  • 原文地址:https://www.cnblogs.com/tszr/p/11007937.html
Copyright © 2020-2023  润新知