get radio button value javascript

JavaScript
document.querySelector('input[name="rate"]:checked').value;
Source

Also in JavaScript: