Opened 14 years ago
Closed 14 years ago
#4062 closed bug (invalid)
1.3.1 always select first 'checked' <input> whatever the attribute filter
Reported by: | p3consulting | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | core | Version: | 1.3.1 |
Keywords: | selector input checked | Cc: | |
Blocked by: | Blocking: |
Description
The following code :
function testJQuery(theForm) {
var gender = $("input[@name='gender']:checked").val() ; var other = $("input[@name='other']:checked").val() ;
$("#result").html(jQuery.fn.jquery + "=" + gender + "/" + other) ;
return false ;
}
with the related <input> fields in a <form> :
<input type="radio" name="gender" value="F" checked />F
<input type="radio" name="gender" value="M" />M
<input type="radio" name="other" value="A" checked />A
<input type="radio" name="other" value="B" />B
produced the following output with version 1.3.1 :
1.3.1=F/F
while the correct answer is given by 1.2.6 :
1.2.6=F/A
Your attribute selector is invalid; the @ symbol isn't valid in jQuery 1.3. It works fine once you remove the @.