JQuery hide inner html except for a tags - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

JQuery hide inner html except for a 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-2.0.2.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from   w  w w  .  j ava 2 s.c om
var children = $(".attribute-pdf").children();
$(".attribute-pdf").html(children)
    });

      </script> 
 </head> 
 <body> 
  <div class="content-body attribute-pdf"> 
   <a href="http://java2s.com"> asdf</a> 1.2 asdf
  </div>  
 </body>
</html>

Related Tutorials