Tuesday, July 6, 2010

jQuery Getting Element Class as Specified in CSS

Programmer Question

I know that Attr gets the exact class of an element. Is there a way to get the element exact class as defined in CSS?
For example an element may have class "title" but be defined in CSS as a descendant selector, something like: .other-list .title {}
I need something to get that exact class value. You can see here the full example:
http://jsfiddle.net/2TMgQ/2/



On click both elements have class "title" but are defined in CSS as 2 different elements.
Thank you



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails