Editor Arrow Download Open
<!DOCTYPE html> <html> <head> <title>jQuery replaceWith() method</title> <script src="jquery-latest.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $(".second").replaceWith("<h3>Heading text</h3>"); }); }); </script> </head> <body> <div> <p class="param first">First paragraph start here...</p> <p class="param second">Second paragraph start here...</p> <p class="param third">Third paragraph start here...</p> </div> <button>Click here to call replaceWith() method</button> </body> </html>
  Preview Arrow