Check Radio button check
Gender : Male Female
Code :
Gender :
<input type="radio" name="gender" id="rdomale" checked="checked" />Male
<input type="radio" name="gender" id="rdofemale" />Female
<input type="button" value="Check" onclick="Checkradio()" />
<script>
function
Checkradio() {
if (document.getElementById('rdomale').checked
== true)
alert('Male
option is selected');
else
alert('Female
option is selected');
}
</script>
No comments:
Post a Comment