var $this= $(this) 前面那個$this 代表什么? 后面$(this)代表是$('p')的內(nèi)容嗎?
$('p').click(function(){
? ?//把p元素轉化成jQuery的對象
? ?var $this= $(this)
? ?$this.css('color','red')
})
$('p').click(function(){
? ?//把p元素轉化成jQuery的對象
? ?var $this= $(this)
? ?$this.css('color','red')
})
2016-11-09
舉報
2016-11-09
前面一個this是html dom對象, 后面的$this 是轉化為了Jqurey 對象