为了账号安全,请及时绑定邮箱和手机立即绑定

代码执行的问题

代码执行的问题

互换的青春 2019-02-22 23:19:01
var a = document.querySelector(".a");var b = document.querySelector(".b");function Student() {    this.bbb();}function add(Student) {    Student.prototype.bbb = function() {        this.getName();        this.jiao();        console.log(this);    };    Student.prototype.getName = function() {        console.log(this);        hh(a, "click", this, false);    };    Student.prototype.jiao = function() {        alert("汪汪汪");    };}function hh(dom, type, fn, capture) {    dom.addEventListener(type, fn, capture);}add(Student);var c = new Student();我点击dom为什么没有响应
查看完整描述

2 回答

?
白猪掌柜的

TA贡献1893条经验 获得超10个赞

你这是啥啊

https://img1.sycdn.imooc.com//5c739bb20001582102450026.jpg

从开始到结束你事件都没给绑定上啊


查看完整回答
反对 回复 2019-02-25
  • 2 回答
  • 0 关注
  • 543 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号