jQuery .append()

jQuery .append() inserts content to the end of the target; difference between .append() and .appendTo();

<script>
$(function() {
    $('div').append($('<strong> - append text</strong>'));
    $('p').append($('<strong>').attr('title', 'text title attr').text(' - append 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 *