Klaus Hartl wrote:
I know that it does what it says it does. That's not the point. The 
point is that it only works on the input element. I'm sorry, but I think 
that should be spelled out. Obviously a number of people thought it 
would retrieve the value of the selected option(s) in a select (or 
multiple select) box and that it would retrieve all text between the 
opening and closing textarea tags.
    

That's not true and the discussion goes into the wrong direction now: 
The val function works for selects, textareas and inputs:

  
I understand that now Klaus, and you're right.
But, there were five or more posts to this thread before anyone stood up and said that the original post was somewhat mistaken, and that .val() *does* indeed work on selects (single ones anyway) and textareas. My point since then has been that perhaps the API should cover this method in better detail.

Okay, I've been set straight on this method and Dave has supplied some good information on the merrits of .attr(), so I'm off to lunch! :o)

Cheers,
Chris
http://stilbuero.de/demo/jquery/val.html.

Wether that is buggy or not in one or the other browser is another 
question. I think the original concern was, that the val() function 
doesn't support values for multiple checked checkbox and selects...


-- Klaus

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


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

Reply via email to