I have the below HTML code that's just a menulist of a default option plus 4 options for the user to choose from, with a submit button. I'm trying to figure out how to write JavaScript code for when the submit button is clicked, the code refers back to the menulist option that the user had selected and returns a phrase that correlates to the option that the user had selected. I'm very new at coding in general, so please let me know if there's additional relevant information I need to provide on this (I tried to keep it succinct).
Code:
<label for="investmentHorizon">Investment Horizon:</label>
<select id="investmentHorizon">
<option value="default">How many years are you planning to invest for?
</option>
<option name='horizonOption' value="ultraShortTerm">Less than 1 year</option>
<option name='horizonOption' value="shortTerm">Between 1 and 3 years</option>
<option name='horizonOption' value="mediumTerm">Between 3 and 10
years</option>
<option name='horizonOption' value="longTerm">More than 10 years</option>
</select>
<input id='submit' type='submit' value='Submit' name=''>