<div class="codetitle"> <span><a style="CURSOR: pointer" data="99258" class="copybut" id="copybut99258" onclick="doCopy('code99258')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code99258"> <br><!DOCTYPE html PUBLIC "-//W3C/ /DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3 .org/ 1999/xhtml"> <br><br><head> <br><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <br><title>js는 div.html<br> <br><br><form method="post; " name="form1 "><label><input type="radio" name="radio" value="1~10세" onclick="ok(this.value);"> 1~10세< /label> <br><label><input type="radio" name="radio" value="11세" onclick="ok(this.value);">11 세</label> <br><label><input type="radio" name="radio" value="12-120세" onclick="ok(this.value);">12- 120세</label> <br><input type="button" onclick="ok()" value="선택 값 테스트"> <br></form> div id="test"> </div> <br><script 언어="javascript" type="text/javascript"> <br><!-- <br>함수 ok() <br>{ <BR>var temp= document.getElementsByName("radio"); <BR>for (i=0;i<temp.length;i ){ <BR>//Traverse Radio <BR>if(temp[i ].checked) <BR>{ <BR>//alert("You selected" temp[i].value) <BR>//Radio 값 가져오기<BR>document.getElementById('test').innerHTML = 임시[i].값 <BR>} <BR>} <BR>} <BR></script> <br><br><br>< ;/html> <br><br> </form> </title> </div>