take value from radio button in js code example
Example 1: get radio button value javascript
document.querySelector('input[name="rate"]:checked').value;
Example 2: radio button group get value javascript
$('input[name=gender]:checked').val();
document.querySelector('input[name="rate"]:checked').value;
$('input[name=gender]:checked').val();