jquery get checked option value code example

Example 1: get value of selected checkbox jquery

$('#checkbox_id:checked').val();
//if checkbox is selected than gets its value

Example 2: how to get the value of radio button in jquery

By LOVE
Here , name=Gender is the name attribute value of the radio button

$("input[name='Gender']:checked").val()

Example 3: get value of checked checkboxes jquery

var values = $('input[name=grepperRocks]:checked')
               .map(() => { return this.value }).get();

Example 4: How can I know which radio button is selected via jQuery

if ($('input[name="radioName"]:checked', '#myForm').length) {
	//Yes, it's checked!
}