<!-- <!DOCTYPE html>
<html>
<body>
<input id="male" type="radio" value="Male" name="gender"> Male
<input id="female" type="radio" value="Female" name="gender"> Female
<button onclick="radio()">Click Me</button>
<script>
function radio() {
// Using querySelector to find the checked radio button and get its value
let selectedGender = document.querySelector('input[name="gender"]:checked').value;
alert("You Selected " + selectedGender);
}
</script>
</body>
</html> -->
1) Does in this code the querySelector will check input like radio or text or date anything now are radio than code will see name and after checked will check the checked radio and display with the help of alert I m right
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)