Compare ‘e.target’ to a jQuery object

To check if e.target has this class you can use the hasClass function.

if ($(e.target).hasClass("selector"))

Or, if you really want to compare objects, note that jQuery selectors return a collection of items, so I think you’ll want

if (e.target === $('.selector')[0])

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)