Avatar of Whing Dela Cruz
Whing Dela Cruz
Flag for Anguilla

asked on 

Html value of radio

Hi experts, I want to get the value of radio by name and put it in an alert. My code below won't work.

<!DOCTYPE html>
<html>
<body>
<div>
<br>Rush Order
<input type="radio" name="kind" value="rush">
<br>Regular
<input type="radio" name="kind" value="regular">
</div>
<br>
<button onclick="Get()">Try</button>

<script>
function Get()
{
      var x = document.getElementByName("kind").value
      alert(x);
}
</script>
</body>
</html>
HTMLJavaScriptASP

Avatar of undefined
Last Comment
Whing Dela Cruz

8/22/2022 - Mon