第十一次作业
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button onclick="stu1()">显示自我介绍</button>
<script >
function Stu(name, age, gender, hobby,time) {
this.name = name;
this.age = age;
this.gender = gender;
this.hobby = hobby;
this.time = time;
this.stu2 = function() {
document.write("大家好,我叫" + this.name + ",今年" + this.age + "岁,性别" + this.gender + ",我的爱好是" + this.hobby + "。" + "现在的时间是:" + this.time);
}
}
var me = new Stu("张京普", 18, "男", "打球","2023年5月21号周天下午10点");
function stu1() {
me.stu2();
}
</script>
</body>
</html>