Finding class of 'this'
Finding class of 'this'
I've seen extensive examples on how to select all elements of a type that have a certain class, and that is a very handy thing. However, when one of the elements on my page handles a click event, I need to know how to find the class of the element that fired off the click event. Somthing like:
var element = $('div.someClass');
except that it must use the 'this' keyword, like:
var element = $((this).someClass);
Then I need to test for the existence of that class and take action. I've used $(this).prev and such, but haven't found anything to select based on attributes of 'this'. Can anyone help?