开发者

Select calling element in javascript

Is there a quick way in javascript to select the element that called the function on an开发者_如何学Go event such as onmouseover or onclick or do i have to use standard document selection in the method to select the element.


this

element.onclick = function () {
    // this == element
    // e.g. this.className = 'Highlighted';
}


check out this?


If I understand your question right then you should be able to use the "this" keyword.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜