Last active
August 29, 2015 14:04
-
-
Save setkyar/b08a44155e941e2d0d9e to your computer and use it in GitHub Desktop.
Looping For Option
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<option value="1">1</option> | |
<option value="2">2</option> | |
<option value="3">3</option> | |
<option value="4">4</option> | |
<option value="5">5</option> | |
var select = document.getElementById("demo"); | |
var i=0; | |
for(i=1;i<=5;i++){ | |
select.options[select.options.length] = new Option(i,i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment