常见组件对象的搞法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cometwo/article/details/52953585
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script type="text/javascript">
            function libin(a,b){
                this.a=a;
                this.b=b;
                this.init();
            }
            libin.prototype.init=function(){
                console.log(this.a+":"+this.b);
                this.wocao();
            }
            libin.prototype.wocao=function(){
                console.log("名字:"+this.a+","+"年龄:"+this.b);
            }

            var sb=new libin('李斌',25)
        </script>
    </head>
    <body>
    </body>
</html>

这里写图片描述

猜你喜欢

转载自blog.csdn.net/cometwo/article/details/52953585
今日推荐