给定代码:
$(element, document).mousedown(function() {
$(this).attr('id'); // get id of the element
});
如何在不使用this
的情况下重写代码?
最佳答案
what is THIS stands for?
在此上下文中,this
指向您当前为其定义 mousedown
属性的元素。
我找不到不在这里使用它的理由。你能详细说明你想做什么吗?
关于javascript - "this"在这里代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7172110/