Chinaunix首页 | 论坛 | 博客
  • 博客访问: 196251
  • 博文数量: 62
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 740
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-19 01:36
文章分类

全部博文(62)

文章存档

2009年(4)

2008年(58)

我的朋友

分类: 系统运维

2008-07-02 20:06:14

<script   language="JavaScript">   
  
   
  </script>   
  <form   name=form1>   
  
<input   type="radio"   name="imgposition"   value="1">   
  
<input   type="radio"   name="imgposition"   value="2">   
  
<input   type="radio"   name="imgposition"   value="3">   
  
</form>   
  <input   type="button"   onclick="chk()">   

for example:


<INPUT type=radio name="radio" CHECKED>1-10 years old
<INPUT type=radio name="radio">11 years old
<INPUT type=radio name="radio">12-120 years old
This example uses script to detect which radio button the user selects.

<SCRIPT>
function detect()
 {
    
if (radio[0].checked)
        alert(
"You're between 1 and 10 years old.")
    
else if (radio[1].checked)
        alert(
"You're 11 years old.")
    
else
        alert(
"You're between 12 and 120 years old.")
 }

</SCRIPT>
阅读(3095) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~