Ron Ron - 6 months ago 25
Javascript Question

Get class name from id in the last apperance of that div in jquery

<div class='user user1' id='newuser'></div>
<div class='user user2' id='newuser'></div>
<div class='user user3' id='newuser'></div>

For getting class name from id i can use

Here how can i get the class name of the last div whose id is newuser ?

if id need to unique then how can i get the class name of last class named user ?




Above code will get the class name and alert it. Hope this will help you :)