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"); } }); });


jquery function

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

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

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Hire Dedicated Jquery Developer

Are You Looking To Hire a jQuery Programmer? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")**, a leading jQuery application development company, can help you build interactive front-end solutions to leapfrog the digital...

JQUERY INTRODUCTION AND SYNTAX | JQUERY HIDE AND SHOW FUNCTION (2020)

jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free,...

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.

Querying DOM in jQuery | jQuery Tutorial for Beginners

This video on Querying DOM in jQuery will help you understand the DOM manipulation methods with hands-on.

Forms and Events in jQuery | jQuery Tutorial | jQuery Training

This video on Forms and Events in jQuery will help you understand what are Forms and how you can create events on them in jQuery.