I’m a beginner in JS programming, I would just like to know how can I get the value of an Option from a Select Box.
Like this one, I’m creating a game which allows the user to select different game difficulties.
If a player chooses Hard as the game difficulty, the AI will then increase its possibility of winning.
How can I get the value of that option to increase the AI’s difficulty.
JavaScript’s alert() method displays a simple modal message box.
You could also log the output to the console using console.log()
Or you could insert the output somewhere in your page, using (for example) element.innerHTML