Reputation: 37741
I can't seem to change between radio buttons correctly using jQuery. Is this a bug in jQuery? Example here: http://jsbin.com/yafik/1/edit
Code from jsbin:
<input type="radio" name="test">
<input type="radio" name="test">
<input type="radio" name="test">
<input type="radio" name="test">
<script>
$("input").eq(1).attr("checked", true);
$("input").eq(2).attr("checked", true);
//$("input").attr("checked", false);
$("input").eq(1).attr("checked", true);
</script>
You can also try to uncomment the third line: $("input").attr("checked", false);
, which I'd expect to just reset all checked attributes.
I would expect it to set the second radiobutton to checked. But if you look at the source code, both the second and third radiobuttons are actually checked.
Upvotes: 0
Views: 186