<input type="radio" name="serve" value="1" checked>
<input type="radio" name="serve" value="2">
<script>
var inpServe = document.querySelectorAll('[name="serve"]');
for(var i = 0; i < inpServe.length; i++) {
inpServe[i].onclick = function() {
var o=document.querySelector('[name="serve"]:checked');
alert(o.value);
}};
</script>