Check if option is selected with jQuery, if not select a default

Posted by htxt on Stack Overflow See other posts from Stack Overflow or by htxt
Published on 2008-09-29T16:47:31Z Indexed on 2010/05/14 18:54 UTC
Read the original article Hit count: 169

Filed under:
|
|
|
|

Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected.

(The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery