add loop in after function - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:after

Description

add loop in after function

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <meta name="viewport" content="width=device-width"> 
  <script src="https://code.jquery.com/jquery-3.1.0.js"></script> 
 </head> //from  w  w w. ja  v a2s. co m
 <body> 
  <div class="block"></div> 
  <script>
$(document).ready(function(){
      var divvs = '';
      for(var i=0;i<15;i++){
        divvs+= '<div>hello</div>'
      }
      $('.block').after(divvs);
});

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

Related Tutorials