Skip to content

Commit 47cc3cc

Browse files
committed
add age option selection for statement
1 parent 82178a3 commit 47cc3cc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

formapi/scripts/script.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//Generate the ages for the age dropdown
2+
window.onload = function() {
3+
const ageSelection = document.getElementById("age");
4+
5+
//Create a for loop that generates up to 99
6+
for (let i = 1; i <= 100; i++) {
7+
const option = document.createElement("option");
8+
option.value = i;
9+
option.text = i;
10+
ageSelection.add(option);
11+
}
12+
};

0 commit comments

Comments
 (0)