Dynamic Lorem Ipsum Placeholder Text Tutorial

Published :
Author :
Adam Khoury
Learn to script placeholder text for web design template purposes using two lines of JavaScript. You specify how many lines of dummy lorem ipsum style sentences will be written and I also included the logic that makes paragraphs occur at intervals that you can specify. We use the modulo operator in order to easily create a condition that establishes paragraphs. <script> var ipsum = "The quick brown fox jumps over the lazy dog. "; for(var i = 0; i < 40; i++){ if(i % 10 == 0 && i > 1){ document.write("<br><br>"); } document.write(ipsum); } </script>