How to replace content in div using Jquery
For that we can use the jQuery html() method to replace inner content of a div or other element.
<script>
$(document).ready(function(){
$("button").click(function(){
$("#custom_id").html("<h1>My Custom Text</h1>");
});
});
</script><div id="custom_id"><p>Click the following button to replace me.<p></div>
<button type="button">Replace HTML</button>