Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Question about option selected="selected" and jquery option:selected.


nelsonm - 1:54 am on Jun 5, 2012 (gmt 0)


Yes, When i tested my theory in jsfiddle, it appears that $(':select').val() does appear to always get the option where <option selected="selected">.

However, $('select').val() merely gets the currently displayed option regardless of whats been preselected via <option selected="selected">.

[jsfiddle.net ]


Thread source:: http://www.webmasterworld.com/javascript/4461372.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com