<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>this的典型应用</title>

</head>
<body>
<!--
(1)在html元素事件属性中使用,如:
<input type=”button” onclick=”showInfo(this);” value=”点击一下”/>

(2)构造函数
function Animal(name, color) {
this.name = name;
this.color = color;
}

(3)这里this是按钮
<input type="button" ></html>

相关文章:

  • 2021-10-18
  • 2021-05-17
  • 2021-11-22
  • 2021-11-22
  • 2021-11-22
  • 2021-10-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
  • 2021-12-22
  • 2022-01-23
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案