I have 2 images. If the person selects one and clicks "NEXT", it redirects to one page. If the person does the same to the other image, it's supposed to redirect to another page.
Here's the code I have:
function getval() {
if (self.value == "1") {
window.location.href = "universal-result.html";
} else if (self.value == "2") {
window.location.href = "disney-result.html"
}
}
<body class="choosepark-body">
<p class="text-choosepark">Você quer ingresso para qual complexo?</p>
<input type="image" src="/Archives/Universal Botao.png" onmouseover="this.src='/Archives/Disney Universal Rosa.png'" onmouseout="this.src='Archives/Universal Botao.png'" class="universal-button" value="1">
<input type="image" src="/Archives/Disney Botao.png" onmouseover="this.src='/Archives/Disney Botao Rosa.png'" onmouseout="this.src='/Archives/Disney Botao.png'" class="disney-button" value="2">
<button onclick="getval()" class="next-button"> NEXT</button>
</body>
How do i make the image get "selected" when the person clicks on it, and when they click "NEXT", it redirects to the page related to that image?
Also, if possible, when the person hovers onmouseover
it changes the icon, but I also wanted to make the icon change when the image is clicked (selected).