<script><!--
function get_radio_value (radio_array){
var i; for (i = 0; i < radio_array . length; ++ i) //radio_array.length是radio??的个数 if (radio_array [i] . checked) return radio_array [i] . value;
return null; //如果一?都没??返回空?}
//--></script> 接着,我?通?以下的表?脚本来?用以上函数: <form>
What is your favorite fruit?<br>
<input type=radio name=fruit value=apple>apple<br>
<input type=radio name=fruit value=orange>orange<br>
<input type=radio name=fruit value=banana>banana<br>
<input type=radio name=fruit value=other>other <input type=text name=echotext> <input type=button value=echo onClick="form . echotext . value = get_radio_value (form . fruit);">
<input type=reset value=clear>
</form> 当点?"echo" 按??,被?中的radio?的?就会?示在echotext框中。
function get_radio_value (radio_array){
var i; for (i = 0; i < radio_array . length; ++ i) //radio_array.length是radio??的个数 if (radio_array [i] . checked) return radio_array [i] . value;
return null; //如果一?都没??返回空?}
//--></script> 接着,我?通?以下的表?脚本来?用以上函数: <form>
What is your favorite fruit?<br>
<input type=radio name=fruit value=apple>apple<br>
<input type=radio name=fruit value=orange>orange<br>
<input type=radio name=fruit value=banana>banana<br>
<input type=radio name=fruit value=other>other <input type=text name=echotext> <input type=button value=echo onClick="form . echotext . value = get_radio_value (form . fruit);">
<input type=reset value=clear>
</form> 当点?"echo" 按??,被?中的radio?的?就会?示在echotext框中。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货