Skip to content

Jquery radio

ythy edited this page Sep 5, 2017 · 1 revision

设默认选中

$('input[name=XXX]:radio').filter(`[value=${XX}]`).prop('checked', true);

获取当前选中, 未选择为 undefined

$('input[name=XXX]:radio:checked').val();
Clone this wiki locally