zoukankan      html  css  js  c++  java
  • 面向对象HTIS

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
        <title>new document</title>
        <script type="text/javascript">
            function activeDiv(){
                var div = document.createElement("div"), self = this;
                div.style.cssText = "position:absolute; 300px; height:200px; left:100px;top:100px; border:1px solid #006699; background:#f5f6fb;";
                div.onclick = function(){
                    self.drag();
                };
                
                this.element = div;
            }
            activeDiv.prototype.drag = function(){
                alert("drag");
            };
            
            
            window.onload = function(){
                var drag = new activeDiv();
                document.body.appendChild(drag.element);
            };
            
        </script>
    </head>
    <body>
    </body>
    </html>
  • 相关阅读:
    2.6
    zuoye
    练习1
    练习
    练习
    4
    3
    2
    1
    1.3
  • 原文地址:https://www.cnblogs.com/yjhua/p/5139409.html
Copyright © 2011-2022 走看看