The jQuery append method is used to insert specified content at the end of the selected element. Please see below example:

    <!DOCTYPE html>  
    <html>  
    <head>  
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>  
    <script>  
    $(document).ready(function(){  
        $("#btn1").click(function(){  
            $("p.htmlappend").append(" <b>New appended text</b>.");  
        });  
          
    });  
    </script>  
    </head>  
    <body>  
    <p class="htmlappend">This is a paragraph.</p>  
    <p>This is another paragraph.</p>  
    
    <button id="btn1">Append text</button>  
    </body>  
    </html>  
Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.