Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

ReplaceWith(content)

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){               $("button").click(function () {                   $(this).replaceWith("<div>" + $(this).text() + "</div>");                 });                                    });     </script>        </head>   <body>     <body>           <button>First</button>                       </body> </html>