Check selected Radio Button value using JavaScript

In this code snippet we are checking gender using JavaScript function.

Check Selected Radio Button value

HTML and JavaScript:

<!--Check selected Radio Button value using JavaScript.-->

      <title>Check selected Radio Button value using JavaScript.</title>
      <script type="text/javascript">
         function checkGender(){				
         		alert("You have selected Male.");
         		alert("You have selected Female.");
   <body style="text-align: center;">
      <h1>Check selected Radio Button value using JavaScript.</h1>
      <b>Choose gender: </b><br><br>
      <input type="radio" id="radioMale" value="Male">Male</input>
      <input type="radio" id="radioFemale" value="Female">Female</input>
      <input type="button" value="Check Gender" onClick="checkGender()"/>


add two numbers using javascript

JavaScript Examples »

Related Examples

All JavaScript Examples

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.