Alex Rivera | Logout

how to append on sibling in jQuery?

Asked 2011-05-27T08:20:32.057
58

I have this code

<div class="data">
    
    <div class="another"></div>
    <!-- need to add element here -->
    
</div>

I want to add the element where I put comment using jQuery how I can append sibling of another using jQuery

Edit
Report

1 Answer

51

I think you want to use the .after() function:

$('div.another').after('<div>');
answered 2011-05-27T08:21:53.067

Your Answer