Okay,so I was coding a simple HTML program and I ran into some problems.
I wanted to make a function that is called when certain options in a dropdown list is selected. My setup looks a bit like this.
<input type="number" id="int_c" value="" style="display:none">
<select id="mode">
<option id="prtr" selected="myFunction()"> Selection 1 </option>
</select>
<script>
function myFunction(){
document.getElementById("int_c").style.display = "block";
}
</script>
That doesn't work,it doesn't even reach the function (I tested it with alert()). So I also tried putting an onchange that calls the function in select.It also didn't work. Any ideas?
onchangeevent of theselectbox itself.