Jquery为a标签的href赋值实现代码
代码如下:
<script type="text/javascript"> function doTest(){ var value = $("input[name='dizhi'][type='radio']:checked").val();//获得选中项的值 $('#a1').attr('href','shoppeisong.php?addid='+value+''); } </script>
要取的INPUT 标签<input name="dizhi" type="radio" id="dizhi" onclick="doTest()" value="<?php echo $rsaddress['id'];?>" />
赋值到
代码如下:
<a id="a1" href="" class="bt" onclick="xx()"> 下一步 </a>
相关推荐
zhangqling 2014-05-27
Jiutocrx 2015-04-10
linkincsdn 2015-10-30
qianwenjie 2015-10-28
moxiaoxi 2016-01-08
sfkong 2016-11-26
DreamLee 2018-02-07
Dansha的花果山 2016-11-26
快乐就好 2016-04-07
wdy00 2015-10-30
hyv 2015-10-28
owhile 2015-10-12
满地星辰 2015-09-30
ghostsk 2015-04-21
jipengx 2015-04-10
zfszhangyuan 2015-02-03
pplxh 2013-12-26