So, I have a simple HTML select block and javascript alert function. I want the select window to have an onchange event that will trigger the javascript alert function. This is what I have so far:
HTML
<div style="float: left">Type: <select id="selector" onChange="jsfunction()">
<option value="Pyr">Pyramidally</option>
<option value="Lin">In-Lines</option>
<option value="Sym">Symmetrically</option>
<option value="Nsym">Non-Symmetrically</option>
</select>
</div>
Javascript
function jsfunction(){
alert("hi");
}
This does not work, and for life I cannot understand why. Most of the other questions of this kind that I have found offer ""around calling a function that I have, or creating the capital onChange'c' that I also have. Any help possible? I would be very grateful.
source
share