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> |
<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> |
<div>div</div>
<p>paragraph</p>