注册 登录
编程论坛 ASP技术论坛

关于radio与label问题联动问题

qinyun 发布于 2010-08-21 23:57, 659 次点击
这个代码如果要将英文部份radio改成label(改变其字体大小)怎么联动呢(注意要是在radio状态改变时不能onClick时)
程序代码:
<script type=[color=#800000]"text/javascript">
function copySelect(ooxx) {
        document.getElementById(ooxx + "_en").checked = "true";
}
</script>
</head>
<body>
<div>
<form action="" method="post">
        <p>
          <input type="radio" id="bj" name="address" checked="checked" onClick="copySelect('bj')" />
          北京
          <input type="radio" id="shh" name="address" checked="checked" onClick="copySelect('shh')" />
          上海
          <input type="radio" id="tj" name="address" checked="checked" onClick="copySelect('tj')" />
          天津
      
          <br />
          <br />
          <input type="radio" id="bj_en" name="address_en" checked="checked" />
          BeiJing
          <input type="radio" id="shh_en" name="address_en" checked="checked" />
          ShangHai
          <input type="radio" id="tj_en" name="address_en" checked="checked" />
          TianJin         
          <br />
          <br />&nbsp;&nbsp;&nbsp;
          <label>BeiJing</label>&nbsp;&nbsp;&nbsp;&nbsp;
          <label>ShangHai</label>&nbsp;&nbsp;&nbsp;&nbsp;
          <label>TianJin</label>
         
</form>

[/color]
3 回复
#2
qinyun2010-08-22 15:01
哪位高手能帮看一下吗
#3
wangjy5002010-08-22 15:11
意思说清楚点。如何联动?
#4
wangjy5002010-08-22 15:19
<script type="text/javascript">
function copySelect(ooxx) {
        document.getElementById(ooxx + "_en").checked = "true";
        document.getElementById("bj_lab").style.fontSize = "16px";
        document.getElementById("shh_lab").style.fontSize = "16px";
        document.getElementById("tj_lab").style.fontSize = "16px";
        document.getElementById(ooxx + "_lab").style.fontSize = "38px";
}
</script>
</head>
<body>
<div>
<form action="" method="post">
        <p>
          <input type="radio" id="bj" name="address" onMouseUp="copySelect('bj')" />
          北京
          <input type="radio" id="shh" name="address" onMouseUp="copySelect('shh')" />
          上海
          <input type="radio" id="tj" name="address" onMouseUp="copySelect('tj')" />
          天津
      
          <br />
          <br />
          <input type="radio" id="bj_en" name="address_en" />
          BeiJing
          <input type="radio" id="shh_en" name="address_en"/>
          ShangHai
          <input type="radio" id="tj_en" name="address_en"/>
          TianJin         
          <br />
          <br />&nbsp;&nbsp;&nbsp;
          <label id="bj_lab">BeiJing</label>&nbsp;&nbsp;&nbsp;&nbsp;
          <label id="shh_lab">ShangHai</label>&nbsp;&nbsp;&nbsp;&nbsp;
          <label id="tj_lab">TianJin</label>
         
</form>
你是不是要想这种效果?

[ 本帖最后由 wangjy500 于 2010-8-22 15:35 编辑 ]
1