web standard/script2010. 11. 17. 09:23

<style type="text/css">
label.on{color:blue;font-weight:bold}
</style>
<script type="text/javascript">
function Set_Faq(obj){
 var Faq_dtList = document.getElementById("radioFom").getElementsByTagName("label");
 for (i=0;i<Faq_dtList.length;i++) {
  if(obj==Faq_dtList[i]){
  Faq_dtList[i].className = (Faq_dtList[i].className = "on" ? "on" : "")  
  } else {
  Faq_dtList[i].className = ""
  }
 }
}
</script>

 

<form id="radioFom" method="post" action="">
 <label for="aa" onclick="Set_Faq(this)" class="on"><input type="radio" id="aa" name="rdo" checked="check" />하하</label><br />
 <label for="bb" onclick="Set_Faq(this)"><input type="radio" id="bb" name="rdo" />하하</label><br />
 <label for="cc" onclick="Set_Faq(this)"><input type="radio" id="cc" name="rdo" />하하</label><br />
 <label for="dd" onclick="Set_Faq(this)"><input type="radio" id="dd" name="rdo" />하하</label><br />
</form>


Posted by 수라