jquery如何获得radio的文本值

2025-02-26 03:39:22
推荐回答(3个)
回答1:

给你举个例子

html部分

xxxyyy

js部分

function getnews(id) {       
                   $("#" + id).val();      
               }

那个 $("#" + id).val() 就是 radio 文本值


当然你也可以做其他方面的函数调用,最主要的就是 id 和 $("#" + id).val()

回答2:

你想要的效果应该是当radio处于选中状态是取相应td里的值吧?
$("input:radio[name=ren]").click(function(){
var tdValue = $(this).nextAll("td").eq(1);

});

回答3:

我想说,需求可以有,但是这样你也不嫌麻烦吗?