Is there a way to use Javascript to extract a list of all the items in a dropdown list please?
So, for example, for this dropdown, I would want to generate something like this:
- 4-6 years
- 8-10 years
- 3-4 years
- 10-12 years
- 6-8 years
(or it can all be on one line, it doesn’t have to be a bulleted list.)
2
Answers
I did attempt it myself.
am I along the right lines?
Just get the
select
element and then you have access to it’s options: