标签:
<!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
标签:
原文地址:http://www.cnblogs.com/love540376/p/4959994.html