[Easy Way] How to check If radio button checked jQuery

 How to check If radio button checked jQuery: In this tutorial, I am going to show you how we can check whether the radio button checked or not using Jquery.

Here, You will see the multiple ways that help you to find the radio button is checked in jquery.


radio button checked jQuery



Let Suppose we have radio button

<input type="radio" name="login" id="rdSelect">

1.First Method

if ($('#rdobutton').is(':checked')) {

            //Perform Action

}


2.Second Method

if ($('#rdSelect').prop('checked')) {

            //Perform Action

}


3.Third Method

$(document).ready(function () {

            $('#rdSelect').click(function () {

                alert('radio selected');

                if ($(this).attr("checked") == "checked") {

                    alert("checked");

                }

            });

});

4.Fourth Method

In this method, here we are using the name of checkbox

<input type="radio" name="registration" id="rdSelect">


if ($("input[name='registration']").attr("checked") == true) {

            alert("checked");

}

If any of the given not working, please feel free to comment below. I hope you like this post about to check if radio button checked Jquery

Post a Comment

Post a Comment (0)

Previous Post Next Post