I want to make a form in HTML that asks your name, last name and country.
Names are no problems, but countries are. I want (need) to use a dropdown list with all the countries of the world, the options of the dropdown list are all elements from a javascript array.
The way I made the js file is like this: i made a function init(){
let list_countries=['afghanistan',...] so I made a var list_functions with all the countries, after that I ran the function
init().
The thing is, how can I represent each of these countries as an option in my dropdown list? I'd like to do this part of coding in html tags
What I have tried:
I tried things like:
<select id="country_list"></select>
<script src="script.js">
</script>
</select><br></br>
I tried swapping select and script etc, but I have no clue :/
I tried googling/finding the solution online, but I can't find a perfect solution to my question.