- 博客(3)
- 收藏
- 关注
原创 详细讲解JavaScript继承
JavaScript继承的常见四种方式(包含ES6) 四种继承方式 构造函数 原型链 构造函数+原型链 ES6类实现继承 构造函数实现继承 function Parent(){ this.name = "Parent" } function Child(){ Parent.call(this) this.type = "child的属性" } console.log(new Child) 在子类构造函数中写了Parent.call(this)指让Parent的构造函数在Chi
2022-02-27 18:21:09
628
原创 Jquery事件绑定
Jquery事件绑定 1.通过事件名称函数绑定 <button id="btn1">事件名称函数</button> $('#btn1').mouseover(function(){ $(this).css('background','orange'); }).mouseout(function(){ $(this).css('background','grey'); }); 2.通过on添加(可以添加一个或多个事件) <button id="btn2">
2021-06-24 22:11:16
117
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人