This post will discuss how to check whether a specific radio button is checked in JavaScript and jQuery.

1. Using jQuery

The idea is to use the .val() method to get the value of matched radio elements. The following program bind to the change event handler of radio button using .change(handler) method and display an alert whenever email value is selected.

jQuery


HTML



Edit in JSFiddle

 
Instead of binding to the change event handler of a radio button, you can bind to click event of a submit button. Here’s a working code:

jQuery


HTML



Edit in JSFiddle

2. Using JavaScript

In plain JavaScript, you can loop through the radio button group and find the relevant checked button.

JS


HTML



Edit in JSFiddle

 
Alternatively, you can use the querySelector() method to get the selected radio button.

JS


HTML



Edit in JSFiddle

That’s all about determining whether a specific radio button is checked in JavaScript and jQuery.