web-profile

jQuery .after()

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

js:

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

html:

<div>div</div>
<p>paragraph</p>​

Leave a Reply

Your email address will not be published.