<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
function Person(name,age,salary){
this.name = name;
this.age = age;
this.salary = salary;
}
//向原型中添加方法
Person.prototype.show = function(){
alert("员工:" + this.name + ",工资是 " + this.salary);
};
var per1 = new Person("扶风",25,4000);
per1.show();
var per2 = new Person("公子",29,4500);
per2.show();
</script>
</body>
</html>