Javascript examples for jQuery Method and Property:replaceWith
Replacing a custom tag to <br>
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.0.2.js"></script> <script type="text/javascript"> $(window).load(function(){//from w ww .ja va 2 s .co m $(document).ready(function () { $("w").replaceWith('<br />'); $("elp").wrap("<h1></h1>"); }); }); </script> </head> <body> <elp> Hello world </elp> <w></w> <elp> test test test </elp> </body> </html>