Remove <br> from specific div - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:remove

Description

Remove <br> from specific div

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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//www .  ja v a 2  s .co  m
$('br', "#grape1, #grape12").remove();
    });

      </script> 
 </head> 
 <body> 
  <div id="grape1"> 
   <p>hello</p> 
   <br> 
  </div> 
  <div id="grape12"> 
   <p>world</p> 
   <br> 
  </div>  
 </body>
</html>

Related Tutorials