document get element by id radio button code example
Example 1: get radio button value javascript
document.querySelector('input[name="rate"]:checked').value;
Example 2: document get element by id radio button
var selectedOption = $("input:radio[name=option]:checked").val()