jQuery потому что

Copy Source | Copy HTML

  1. function checkRadios() {
  2.         var el = document.formregions.elements;
  3.         var valueofchecked =  0;
  4.         for(var i =  0 ; i < el.length ; ++i) {
  5.             if(el[i].type == "radio") {
  6.                 var radiogroup = el[el[i].name];
  7.                 var itemchecked = false;
  8.                 for(var j =  0 ; j < radiogroup.length ; ++j) {
  9.                     if(radiogroup[j].checked) {
  10.                         itemchecked = true;
  11.                         valueofchecked = radiogroup[j].value;
  12.                         break;
  13.                     }
  14.                 }
  15.                 if(!itemchecked) {
  16.                     alert("Пожалуйста, выберите сначала регион.");
  17.                     if(el[i].focus)
  18.                         el[i].focus();
  19.                     return false;
  20.                 }
  21.             }
  22.         }
  23.         return valueofchecked;
  24.     }

=

Copy Source | Copy HTML

  1. $('#regionstree input:radio:checked').val()