라디오 버튼을 체크하기 JS

//---------------------------------------------------------------------------------- 라디오 버튼 자동 체크
function auto_radio(this_s,v_value){ //라디오 버튼인지 체크하지는 않습니다.
 var m =this_s.length;
 if(!m){
  this_s.checked = true;
  return;
 }
 for(var i=0;i<m;i++){
  if(this_s.value == v_value){
   this_s[i].checked = true;
   return;
  }
 }
  this_s[0].checked = true;
}

//------------------------------------------------------------------------
할때마다 for 돌리기 귀찮아서 만들었습니다.

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -