jQuery.val and :checked
jQuery.val and :checked
I find the behavior of the .val() method odd when combined with checkboxes and radiogroups. In my opinion, when calling $(":checkbox").val() I would expect it to return some indication of the value of those checkboxes, such as an array of checked values, but instead it just returns the value of the first checkbox in the group, disregarding whether or not that checkbox is even checked. The same holds true for radio groups, although they could simply just return the value of whichever radio button has been checked.
It is my understanding that .val() is just a convenience method for accessing element.value, but if this is true, why not make it more useful? Does this make sense? Anyone else feel this way?