如何根据name和value选中radio [问题点数:40分,结帖人zzxap
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html
>
<
head
>
<
script
type
=
"text/javascript"
>
function getRadioBoxValue(radioName, radiovalue)
{
var obj = document.getElementsByName(radioName);
for(i = 0; i < obj.length; i++)
{
if(obj[i].value == radiovalue)
{
obj[i].checked = true;
}
}
return true;
}
</
script
>
</
head
>
<
body
>
<
input
type
=
'radio'
name
=
'layoutt'
value
=
102
>102
<
input
type
=
'radio'
name
=
'layoutt'
value
=
103
>103
<
input
type
=
'radio'
name
=
'layoutt'
value
=
104
>104
<
input
type
=
'radio'
name
=
'layoutt'
value
=
105
>105
<
div
style
=
"padding-top:20px"
>
<
input
type
=
"button"
name
=
"btn1"
value
=
"选择102"
onclick
=
"getRadioBoxValue('layoutt','102')"
/>
<
input
type
=
"button"
name
=
"btn1"
value
=
"选择103"
onclick
=
"getRadioBoxValue('layoutt','103')"
/>
<
input
type
=
"button"
name
=
"btn1"
value
=
"选择104"
onclick
=
"getRadioBoxValue('layoutt','104')"
/>
<
input
type
=
"button"
name
=
"btn1"
value
=
"选择105"
onclick
=
"getRadioBoxValue('layoutt','105')"
/>
</
div
>
</
body
>
如何根据name和value选中radio [问题点数:40分,结帖人zzxap的更多相关文章
- MVC 中@Html.DropDownListFor() 设置选中项 这么不好使 ? [问题点数:40分,结帖人lkf181]
http://bbs.csdn.net/topics/390867060 由于不知道错误原因在哪 我尽量把代码都贴出来吧:重点是:在 Controller 类里 我给 SelectListItem集合 ...
- TreeView如何实现选中的节点上移或下移 [问题点数:20分,结帖人nww2002]
在TreeView中,如何实现选中一节点,右键点击上移或下移 TTreeNode.MoveTo() 一.获得Tree上的结点var NowNode : TTreeNode;begin NowNode ...
- 点击文字选中radio
<html><body><form action="" name="form1" method="post"& ...
- jquery选中radio或checkbox的正确姿势
jquery选中radio或checkbox的正确姿势 Intro 前几天突然遇到一个问题,没有任何征兆的..,jquery 选中radio button单选框时,一直没有办法选中,后来查了许多资料, ...
- jquery动态选中radio,获取radio选中值
//动态选中radio值,1:表示radio的name 2:表示后台传过来的radio值$(":radio[name='1'][value='" + 2 + "']&qu ...
- jquery radio的取值 radio的选中 radio的重置
radio 按钮组, name=”sex”. <input type="radio" name="sex" value="Male"& ...
- JQuery 选中Radio
<tr> <td> <input type="radio" name="rdb" value="启用" che ...
- jsp根据参数默认选中radio
<% int vol = (Integer)request.getAttribute("cardtype") ; %> <input type="rad ...
- angularjs如何默认选中radio
(1). 使用 ng-checked 即可. <label class="radio-inline"> <input name="display&q ...
随机推荐
- spring AOP 之二:@AspectJ注解的3种配置
@AspectJ相关文章 <spring AOP 之二:@AspectJ注解的3种配置> <spring AOP 之三:使用@AspectJ定义切入点> <spring ...
- #13 让代码变得Pythonic
前言 在学习Python的过程中,肯定听说过这么一个词:Pythonic,它的意思是让你的代码很Python! 一.列表生成式 前面有一节专门讲解了Python的列表,其灵活的使用方法一定让你陶醉其中 ...
- windows下mongodb基础玩法系列二CURD附加一
windows下mongodb基础玩法系列 windows下mongodb基础玩法系列一介绍与安装 windows下mongodb基础玩法系列二CURD操作(创建.更新.读取和删除) windows下 ...
- 【学习笔记】JS设计模式总结
前言:这段时间都在学习Vue的知识,虽然手边放着一本js高程,但确实好久没有好好复习了.温故而知新,因此特意把JS常见的设计模式总结,希望对大家有所帮助... 1. 工厂模式 释义:像工厂一样流水线般 ...
- SpringMVC Hello World
前言 新年伊始,元宵佳节,窗外灯火通明,炮声连连.北漂以来第一次一个人在北京过十五. 切入正题,收假后一边要赶项目进度还要学习java,so在元宵佳节之际写了第一篇SpringMVC Hello Wo ...
- Layui上传图片 带接口
layui.use('upload', function () { var upload = layui.upload; upload.render({ elem: '#LAY_avatarUploa ...
- T-SQL基础(一)之简单查询
名词解释 SQL: Structured Query Language,结构化查询语言,是一种在关系型数据库中用于管理数据的标准语言.SQL是一种声明式编程语言,即只需表明需要什么而无需关注实现细节( ...
- Rancher2.0构建kubernetes(K8S)集群
一.环境准备 1.准备至少3台CentOS7版本的虚拟机 # IP地址 主机名称 192.168.1.160 rancher 192.168.1.161 master 192.168.1.162 no ...
- React 入门学习笔记整理(三)—— 组件
1.定义组件 1)函数组件 function GreateH(props){ return <div> <h2>hello,{props.name}</h2> &l ...
- easyUI combobox combotree 模糊查询,带上下键选择功能,待完善。。。。
/2017年4月9日 11:52:36 /** * combobox和combotree模糊查询 * combotree 结果带两级父节点(手动设置数量) * 键盘上下键选择叶子节点 * 键盘回车键设 ...