Set div element content with html - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Set div element content with html

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>A valid page</title> 
   </head> 
   <body> 
      <div class="productInfo">
         Whatever./*from   www .j a  v a 2  s  .  co  m*/
      </div> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
      <script>
    $(function() {
        $('div.productInfo').wrap('<div id="productDetails"></div>');
    });

      </script>  
   </body>
</html>

Related Tutorials