helloobj.htm

来自「javascript oop & package sample」· HTM 代码 · 共 27 行

HTM
27
字号
<script>
function hello() {
    this.id = "200200431";
    this.name = "冠己荐";
}

hello.prototype = {
	sayHello : function() {
		alert("荤锅1 : " + this.id + ", 捞抚1 : " + this.name);
	},

	sayHello2 : function() {
		alert("荤锅2 : " + this.id + ", 捞抚2 : " + this.name);
	}

}

hello.prototype.sayHello = function() {
		alert("荤锅3 : " + this.id + ", 捞抚3 : " + this.name);
}

var helloObj = new hello();
helloObj.sayHello();
helloObj.sayHello2();
</script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?