I have 2 inputs of type radio
. In them, I'm trying to trigger my JS method. However, clicking on the radio button , nothing is done. You do not even want to get to the JS function:
function onView1(){
alert("oi");
var x = document.getElementsByName("user_1");
if(x.value== 1){
location.href = "option_user.html";
}else {
alert("nao deu");
}
}
<tr>
<td>
<div align="center">
<br><br>
<img src="images/Untitled-1.jpg"><br><br>
<input type="radio" name="user_1" value="1" id="1" onkeyup="onView1()"/>
</div>
</td>
</tr>