Javascript/Jquery sequence of while loop - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example

Description

Javascript/Jquery sequence of while loop

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.8.3.js"></script> 
      <script type="text/javascript">
    $(function(){// w  ww. j  a  v a2 s .com
console.log("meh");
var i = 0;
while (i < 16) {
    $('#wrapper').append("<div class='grid'></div>");
    i++;
}
    });

      </script> 
   </head> 
   <body> 
      <div id="wrapper"> 
         <div class="grid"></div> 
      </div>  
   </body>
</html>

Related Tutorials