edge case for selecting a checked radio input with jquery
Posted
by altvali
on Stack Overflow
See other posts from Stack Overflow
or by altvali
Published on 2010-04-02T12:08:53Z
Indexed on
2010/04/02
12:13 UTC
Read the original article
Hit count: 363
Hi all!
I have a problem selecting a checked radio button with jquery. The radio buttons are generated by a function from a MVC that i'd rather not change and its name is like id[number].
Simply put, I have to check if any of these buttons are checked:
<input type="radio" name="id[1]" value="1"/>
<input type="radio" name="id[1]" value="2"/>
The problem is that jQuery('input:radio[name=id[1]]:checked').val() will select some function from the jQuery library.
Any help will be much appreciated.
© Stack Overflow or respective owner