当前位置: 首页 > news >正文

产品宣传网站的作用客服外包平台

产品宣传网站的作用,客服外包平台,短网址转换器,做网站挂广告赚钱犯法吗2019独角兽企业重金招聘Python工程师标准>>> Radio 对象代表 HTML 表单中的单选按钮。在 HTML 表单中 <input type"radio"> 每出现一次&#xff0c;一个 Radio 对象就会被创建。 单选按钮是表示一组互斥选项按钮中的一个。当一个按钮被选中&#xf…

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Radio 对象代表 HTML 表单中的单选按钮。在 HTML 表单中 <input type="radio"> 每出现一次,一个 Radio 对象就会被创建。

单选按钮是表示一组互斥选项按钮中的一个。当一个按钮被选中,之前选中的按钮就变为非选中的。当单选按钮被选中或不选中时,该按钮就会触发 onclick 事件句柄。您可通过遍历表单的 elements[] 数组来访问 Radio 对象,或者通过使用 document.getElementById()。由www.169it.com搜集整理


一、单选按钮控件语法

1
< input  name = "Fruit"  type = "radio"  value = ""  />

使用html input标签,name为自定义,type类型为“radio”的表单.


二、radio单选按钮代码举例

1、html代码片段:

1
2
3
4
5
6
7
8
< form  action = ""  method = "get" >
您最喜欢水果?< br  />< br  />
< label >< input  name = "Fruit"  type = "radio"  value = ""  />苹果 </ label >
< label >< input  name = "Fruit"  type = "radio"  value = ""  />桃子 </ label >
< label >< input  name = "Fruit"  type = "radio"  value = ""  />香蕉 </ label >
< label >< input  name = "Fruit"  type = "radio"  value = ""  />梨 </ label >
< label >< input  name = "Fruit"  type = "radio"  value = ""  />其它 </ label >
</ form >

2.举例代码片段二(默认选中设置举例):

1
2
3
< input  type = "radio"  name = "identity"  value = "学生"  checked = "checked"  />学生
< input  type = "radio"  name = "identity"  value = "教师"  />教师
< input  type = "radio"  name = "identity"  value = "管理员"  />管理员

在代码举例二种, checked="checked" 表示默认选中项设置。


3.代码举例三(js操作radio):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html >
< head >
< meta  http-equiv = "Content-Type"  content = "text/html; charset=gbk" >
< script >
<!--
     //选中2返回的也是1,找到第一个ID为该值的DOM,弹出 1
     function getVById(){alert(document.getElementById('test11').value);}
     function getVByName(){
         var tt = document.getElementsByName('test11');
         for (var iIndex = 0; iIndex < tt.length ; iIndex++ )
         {
             if(tt[iIndex].checked)
             {
                 alert(tt[iIndex].value);
                 break;
             }
         }
     };
-->
</ script >
< title >http://www.169it.com</ title >
</ head >
< body >
     < input  type = "radio"  id = "test11"  name = "test11"  value = "1"  />测试1
     < input  type = "radio"  id = "test11"  name = "test11"  value = "2"  />测试2
     < input  type = "button"  value = "BTN_ByID"  onclick = "getVById()"  />
     < input  type = "button"  value = "BTN_ByName"  onclick = "getVByName()"  />
</ body >
< html >
  • 文章来源:html中<radio>单选按钮控件标签用法解析及如何设置默认选中


转载于:https://my.oschina.net/u/1766067/blog/345522

http://www.hengruixuexiao.com/news/44101.html

相关文章:

  • 做内容网站赚钱吗长沙网站推广公司
  • pc端宣传网站开发网站seo服务公司
  • 找人设计网页多少钱太原seo关键词优化
  • 渭南免费做网站公司谷歌商店下载不了软件
  • 网站的做网站公司百度推广的步骤
  • 购物网页代码北海seo快速排名
  • 网站建设人员的岗位职责爱站权重查询
  • 做视频网站需要什么服务器品牌推广方式都有哪些
  • 在线装修设计网站seo关键词布局技巧
  • 安徽合肥做网站的公司有哪些南平seo
  • 企迪网关键词优化公司
  • 电子政务网站建设qq刷赞网站推广
  • wordpress图片整站seo网站推广目的
  • 手机网站源程序沈阳seo网站关键词优化
  • 网站做链接算侵权吗制作网站的最大公司
  • 大连软件开发网站建设网站建设全包
  • wordpress怎么ftp建站手机免费建站系统
  • 深圳市做门窗网站有哪些推广品牌推广的方式有哪些
  • 医疗机械网站怎么做网络公关公司
  • 做推广便宜的网站推广策划方案模板
  • 个人网站可以直接做微信登陆吗大连网站优化
  • 株洲网站建设联系方式抖音关键词查询工具
  • 网站建设毕业实习报告2020最近的新闻大事10条
  • 网站开发视频教程新媒体营销推广方案
  • 证券投资网站建设微信最好用的营销软件
  • 济南集团网站建设费用视频互联网推广选择隐迅推
  • 如何重装一下wordpress深圳seo排名
  • 江西做网站公司seo网站推广企业
  • 网站源码获取在线搜狗推广登陆
  • 网站建设自由容器是什么意思网站百度手机端排名怎么查询