I guess this’ll be my first post. Lol. Anyways,
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.
<select name="difficulty" id="difficulty"> <option value="easy" selected="selected">Easy</option> <option value="normal">Normal</option> <option value="hard">Hard</option> </select>