jQuery .after()

jQuery .after() inserts content after target element; difference between .after() and .insertAfter();

<script>
$(function() {
    $('div').after($('<strong> - after text</strong>'));
    $('p').after($('<strong>').attr('title', 'text title attr').text(' - after text with title attr'));
});</script>
<div>div</div>
<p>paragraph</p>

Leave a Reply

Your email address will not be published. Required fields are marked *