i need help :) I have a Div, and in this Div are many other Div's with a Class. And i need to change only the last Div's Class inside the Div:
<div id='main'>
<div class='inside'></div>
<div class='inside'></div>
<div class='inside'></div> <- Only this to be changed?
</div>
I have a jQuery function that searches for every div inside the main Div:
$('#main').find('.inside').each(function() {
alert($(this).attr('class'));
});
This does work but when i try to change only the last Divs Class it changes the Classes of all Divs inside the main Div. Is it possible to change only the last inside class Div?
Thanks!