I am trying to get the values that a user chooses from fieldset
to then show a alert
that shows the price depending on the chosen option.
function formAlertCompra(){
var year = fieldset.getElementById('año').value;
var result_year=year*10;
alert(result_year);
return false;
}
<form ethod="post" onsubmit="formAlertCompra();"><fieldset data-role="fieldcontain" id="año">
<label for="año">Año:</label>
<select id="año_compra" name="año_compra">
<option>Seleccione Uno</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
</select>
<input type="submit" value="Register"> </fieldset>
</form>
However, when selecting the year, no alert is coming out. What would be my mistake?