Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script> <script> $(document).ready(function () { $('<span>This is span</span>').replaceAll('p'); }); </script> </head> <body> <h1>Demo: jQuery replaceAll() method </h1> <div> <p>This is paragraph.</p> </div> <p>This is another paragraph.</p> </body> </html>
Result: