When a user inputs the correct value (a number) into an input of type "number," I want a button to appear. I attempted
var check=document.getElementById("buttonID").value == "1"
followed by an if
statement, but it seems I made a mistake somewhere.
Here's how I envision it working:
User inputs: 1 (then presses enter)
Button appears
Currently, I have a hidden button set using display:none
and an input field, that's all.
#my input
<div class="input-ruta">
<input id="val" type="number">
</div>
#the button i want to appear when the input value is 1
<div class="container">
<a href="link" target="_blank"><button id="button2">
<img class="image-class" src="image.png">
</button></a>
</div>
My code might be messy, but I hope you understand what I'm trying to achieve.