Javascript examples for String Operation:String Format
Add a tick mark based on a counter
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w . java 2 s . c o m var count = 5; function countClicks() { count = count + 1; var ticks = Array(count+1).join("✔"); document.getElementById("p2").innerHTML = count+' '+ticks; } countClicks(); } </script> </head> <body> <div id="p2"></div> </body> </html>