unwrapping the tags - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:unwrap

Description

unwrapping the tags

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.9.1.js"></script> 
  <style id="compiled-css" type="text/css">

ul{border: 1px solid lime;margin:2px;}


      </style> 
  <script type="text/javascript">
    $(window).load(function(){// www.j  av  a 2  s . c  om
$('ul li').wrap('<ul/>').end().find('ul').unwrap('ul');
    });

      </script> 
 </head> 
 <body> 
  <ul> 
   <li></li> 
   <li></li> 
   <li></li> 
  </ul>  
 </body>
</html>

Related Tutorials