The append() method in JQuery is used to insert a content at the end of an HTML element.
<html>
<head>
<title> My First Programme </title>
</head>
<body>
<h1> JQuery </h1>
<p>New Code</p>
<button> Click to set a new value </button>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"> </script>
<script>
$('button').click( function() {
$('p').append(" plus another code");
});
</script>
</body>
</html>
So, in the above code, we have to to add a new content plus another code, and make it New Code plus another code.
<p>New Code</p>
And we have done it using the JQuery statement,
$('button').click( function() {
$('p').append(" plus another code");
});So, on button click, the append() function is called,
$('p').append(" plus another code");And the content of <p> element,
New Code
Is added with,
plus another code
And the new content is printed on the screen,
New Code plus another code