开发者

jQuery, radio button getting value

开发者 https://www.devze.com 2022-12-15 17:32 出处:网络
Hay, how ca开发者_运维知识库n i get the value of this? i.e. which one is selected. <input type=\'radio\' name=\"thing\" value=\"on\" checked>

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

精彩评论

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