$('#menu').on('click', 'li', function(e) {
var currentLi = e.currentTarget
console.dir(e.currentTarget)
console.dir(currentLi instanceof jQuery) //false
console.dir(currentLi instanceof HTMLElement) //true
})
$('#menu').on('click', 'li', function(e) {
var currentLi = e.currentTarget
console.dir(e.currentTarget)
console.dir(currentLi instanceof jQuery) //false
console.dir(currentLi instanceof HTMLElement) //true
})
本文标题:instanceof判断一个对象是jQuery对象还是DOM对象
本文链接:https://www.haomeiwen.com/subject/ansmsftx.html
网友评论