Free programming examples and instructions

jQuery appent to p tag

Code and example for how to append html tags to p tag using jQuery

by Athil

Posted on 13 May 2017 Category: jQuery Views: 909

Edited on 03 Jun 2017



Hi, Here I am going to show how to append HTML to <p> tags.

  $("#Myp").append("<b>My new text</b>");

Full Code

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <title>Demo for jQuery append to p tag</title>
       <script type="text/javascript" src="js/jquery.min.js" ></script>
    <h1>Demo for jQuery append to p tag </h1>

    <p id="Myp">my paragraph</p>
    <button id="btnAppend" type="submit">Append to p</button>

        function () {
            $("#Myp").append("<b>My new text</b>");


Leave a Comment: