Run ยป
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> </head> <body> <div class="col-md-2 form"> <div class="title">Gender</div> <div class="form-item"> <input type="radio" name="gender" id="radio-1" value="1" class="custom" /> <label for="radio-1">Male</label> <input type="radio" name="gender" checked id="radio-2" value="2" class="custom" /> <label for="radio-2">Female</label> <input type="radio" name="gender" id="radio-3" value="3" class="custom" /> <label for="radio-3">Other</label> </div> </div> <script> var gender = $(".form .form-item input[name='gender']:checked").val(); alert(gender); </script> </body> </html