How to check which radio button is checked with jquery?

How to check which radio button is checked with jquery?

I'm trying to print text depending on which radio button is checked. Can you tell me what's wrong?

I'm trying to print text depending on which radio button is checked. Can you tell me what's wrong?

Just getting the "error" output.

<input type="radio" name="feedback-form-visit-again" id="genderm" class="gendercheck" value="0" required> m
<input type="radio" name="feedback-form-visit-again" id="genderw" class="gendercheck" value="1"> w

<span class="gendertest">Output</span> $(document).ready(function() { $(".gendercheck").change(function() { if (gender.value == 0) { $(".gendertest").text("m"); } else if (gender.value == 1) { $(".gendertest").text("w"); } else { $(".gendertest").text("error"); } }); });


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Using The jQuery .each() Function

<strong>jQuery each</strong>&nbsp;is one of the better-used functions in&nbsp;<strong>jQuery</strong>&nbsp;so I think it’s great to understand what you can do with it.

jQuery ajax get request method example

### jQuery Ajax Get Request Method Example This article is originally published at [https://www.tutsmake.com/jquery-api-ajax-get-method-example/](https://www.tutsmake.com/jquery-api-ajax-get-method-example/...