<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>New Web Project</title>
        <style type="text/css">
            span{
                color: #66A300;
                font-family: "Arial Black";
            }
        </style>
    </head>
    <body>
         <div id="main">
             <span>hello!</span>
         </div>
         
         <script type="text/javascript">
             Node.prototype.prependChild = function (newNode){
                 this.insertBefore(newNode,this.firstChild);
             }
             
             var main = document.getElementById("main");
             var node = document.createElement("span");
             node.innerHTML = "World,";
             main.prependChild(node);
         </script>
    </body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-02-01
  • 2021-07-08
  • 2022-01-10
  • 2022-12-23
  • 2021-10-27
猜你喜欢
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案