var rbtNew = document.getElementById('rbtNew');
var rbtOld = document.getElementById('rbtOld');
if (rbtNew != null && rbtOld != null) {
if (rbtNew.checked == false && rbtOld.checked == false) {
alert("our Alert Message ");
return false;
}
}
In the above code rbtNew != null means radio button is exist in page source otherwise it will have null value.