this 是什么作用有什么含義
$("#test3").on({
? ? ? ? mousedown: function(e) {
? ? ? ? ? ? $(this).text('觸發事件:' + e.type)
? ? ? ? },
? ? ? ? mouseup: function(e) {
? ? ? ? ? ? $(this).text('觸發事件:' + e.type)
? ? ? ? }
? ? })
$("#test3").on({
? ? ? ? mousedown: function(e) {
? ? ? ? ? ? $(this).text('觸發事件:' + e.type)
? ? ? ? },
? ? ? ? mouseup: function(e) {
? ? ? ? ? ? $(this).text('觸發事件:' + e.type)
? ? ? ? }
? ? })
2017-07-21
舉報
2018-06-02
$(this)指當前ID為test3的元素
2017-10-26
當前發生事件的對象
2017-08-10
this是一個html的元素,即一個DOM對象。這里的this指向的,是id為test3的div,而$(this)是將所有id為test3的dom對象封裝成了一個jQuery對象。
2017-07-21
應該是指當前元素吧 這里是一個dom綁定了兩個事件 我的理解 不知道對不對 ?