Why doesn't $("#RadioButtons:checked").val() work in IE?

Posted by Randy Heaps on Stack Overflow See other posts from Stack Overflow or by Randy Heaps
Published on 2010-05-27T19:51:31Z Indexed on 2010/05/27 20:11 UTC
Read the original article Hit count: 243

Filed under:
|

Why doesn't $("#RadioButtons:checked").val() - id selector - work in Internet Explorer but $("input:radio[name='RadioButtons']:checked").val() - name selector - does?

<input name="RadioButtons" id="RadioButtons" type="radio" value="1" checked>
<input name="RadioButtons" id="RadioButtons" type="radio" value="2">

<script>
  alert($("#RadioButtons:checked").val());
  alert($("input:radio[name='RadioButtons']:checked").val());
</script>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about selectors