星空网 > 软件开发 > Java

jQuery 获取 radio 选中后的文字

如果html为 <input type="radio" id="test" name="test" value="1" /><span>测试1</span>
则js为:
$("input[name='test']:checked").next("span").text()


如果html为
<input type="radio" id="test" name="test" value="1" /> <label for="test">测试1</label> 

<input type="radio" id="test1" name="test" value="2" /> <label for="test1">测试2</label>

则js为:$("input[name='test']:checked").next("label").text()
 
 



原标题:jQuery 获取 radio 选中后的文字

关键词:jquery

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流