zoukankan      html  css  js  c++  java
  • Javascript 中的 with

    如下:

    <!DOCTYPE html>
    <html>
      <head>
        <title>js2.html</title>
      </head>
      
      <body>
        <script type="text/javascript">
        with (document)
        {    
            write("<ol>");
            write("<li>hello</li>");
            write("<li>world</li>");
            write("<li>hello world</li>");
            write("</ol>");
        }    
        </script>
        <br>
      </body>
    </html>

    结果:

    1. hello
    2. world
    3. hello world
  • 相关阅读:
    腾讯安全上海游戏部门笔试题
    2017
    2016
    2015
    2014
    2013
    2012
    2011
    2010
    2009
  • 原文地址:https://www.cnblogs.com/backpacker/p/2610830.html
Copyright © 2011-2022 走看看