Insert the same text string several times based on calculations - Javascript jQuery

Javascript examples for jQuery:String

Description

Insert the same text string several times based on calculations

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.9.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from  w ww .j  a  v a2  s . co m
var howmanytimes = 500 / 100;
for(var i = 0; i <= howmanytimes ; i++) {
    $('#mytextmultiplied').append('my' + "<br />");
}
    });

      </script> 
 </head> 
 <body> 
  <p id="my"></p>  
 </body>
</html>

Related Tutorials