Can dropdown list be made in js using a for loop or without using a for loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can dropdown list be made in js using a for loop or without using a for loop?

Like List item 1: 00 List item 2: 01

11th Jun 2020, 4:24 PM
Aman Kumar
Aman Kumar - avatar
5 Answers
+ 3
Sorry I missed your reply. You can find how to make a dropdown list here: https://www.w3schools.com/howto/howto_js_dropdown.asp/ In this simple code I generated the list(not dropdown) contents using a while loop: https://code.sololearn.com/W2oao4yPQ5GD/?ref=app Merging both sources you should be able to make a dropdown in Javascript by your own.
13th Jun 2020, 2:15 AM
Kevin ★
+ 2
It can be made using: -for loop -while loop -recursion -[ ].map method -generators -for of loop -and more if you are creative enough.
11th Jun 2020, 6:53 PM
Kevin ★
+ 2
Can you provide an example
12th Jun 2020, 5:46 AM
Aman Kumar
Aman Kumar - avatar
+ 2
Good work👍
13th Jun 2020, 6:44 PM
Kevin ★
13th Jun 2020, 10:10 AM
Aman Kumar
Aman Kumar - avatar