开发者

jQuery, radio button getting value

Hay, how ca开发者_运维知识库n i get the value of this? i.e. which one is selected.

<input type='radio' name="thing" value="on" checked>
<input type='radio' name="thing" value="off">

I cant get the value with

$("input[name='thing']").val()

Thanks


How about:

$("input[name='thing']:checked").val()


solution is found

$("input[name='thing']:checked").val()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜