Create a paragraph element with some text and append it to the end of the document body using jQuery.

<!DOCTYPE html>

<html>

<head>

         <title></title>

         <script

  src="https://code.jquery.com/jquery-3.5.1.slim.min.js"

  integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs="

  crossorigin="anonymous"></script>

</head>

<body>

         <p>dummy text in cdsjldcjb hsdn ashvc</p>

<button>add paragrapah</button>

<script type="text/javascript">

         $("button").click(function(){

    $("p").append("<br>append text");

         })

</script>

</body>

</html>



Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post