Hello Reader's!
If you want to make an alert message for everytime user select the button then you can use the following JS as below:-
Lets say our HTML is like this:-
<input class="gender" type="radio" name="sex" value="male">Male <br> <input class="gender" type="radio" name="sex" value="female">Female
Then the JS will go like this:-
$(document).ready(function () {
$(".gender").change(function () {
var val = $('.gender:checked').val();
alert(val);
});
});
Output:-
Now when user select male or female an alert box will open
0 Comment(s)