I am developing a new design for which I need to get the name of the class of a div element above another div element.
Like this:
<div class="random name a"></div>
<div class="the name of this class depends on the name of the class above this div"></div>
Is there any way of knowing this with jQuery? I been looking around but couldn’t find any clue yet.
Thanks a lot!
You can use .prev for this – http://api.jquery.com/prev/