Jquery removing children element - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:children

Description

Jquery removing children element

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.2.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*w w  w . j av  a 2s .  c o  m*/
$("div").children("p,div").remove();
    });

      </script> 
   </head> 
   <body> 
      <div> 
         <p>Hello</p> 
         <h1>Stack Overflow</h1> 
         <div>
            This is a wonderful site
         </div> 
      </div>  
   </body>
</html>

Related Tutorials