jQuery innerhtml

by shraddhapaghdar

HTML

<div class="container">Hello World! Welcome to the DelftStack.</div>
<button type="button">Change the text</button>

JavaScript

$("button").click(() => {
  $( "div.container" ).html( "<p>Thank you for visiting. <em>DelftStack!</em></p>" );
})