Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop backwards javascript

function seethestars1() {
        for (var i = 0; i <= 10; i++) {
            for (var j = 0; j < i; j++) {
                document.getElementById("emptytext2").value += "*";
            }
            document.getElementById("emptytext2").value += "
";
        }
    }

 <textarea id="emptytext2" name="S2">

 <input id="emptytext3" type="button" value="Click for the stars" onclick ="seethestars1()" />
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #javascript
ADD COMMENT
Topic
Name
4+2 =