【发布时间】:2015-10-06 08:40:36
【问题描述】:
function count(x,y) {
this.x;
this.y;
this.plus = function() {
return this.x + this.y;
}
this.checkResult = function() {
$("#test").click(function() {
this.plus(); //help here
});
}
}
<p id='test'></p>
"this" 返回被点击的元素,那么如何在 jQuery 中运行方法呢?
【问题讨论】:
-
我认为您需要学习 javascript,然后针对您遇到的问题提出问题。你可以从this开始。
标签: javascript jquery class object this