Mike Alsup wrote:
 I have to admit, I didn't understand that $.val() was limited to only input
elements, and I expected it to get the value of any element.
    

val() is confusing because of its hybrid nature.  Only a few elements
support the "value" attribute (input, option, button and param), but
any object *could* have a value property, and some, most notably the
select element, always do.

  
So this function *could* retrieve the value of the selected option in a select box? If val() is confusing then it's *exact* behavior should be documented... and I mean more explicitly. Developer's who are moving from desktop application development to Web / RIA type development, may latch on to jQuery because of it's relative ease, but may not fully understand some of the intricacies of the DOM.

Just my two cents I guess.
And there are cross browser issues of course.  For example, IE
promotes a button's text to be its "value" but FF does not.

Mike
  
Hmm... I didn't know that. I don't develop much for FF.

Chris
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to