I cannot seem to find it. Thanks!
Example:
$("#MySelect").append(new Option("MyOption", "MyOption", true, true));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Mozilla Dev Center is the de facto standard documentation site for all things JavaScript.
optionelement reference:<option> elementHTMLOptionElementinterface (which is implemented by the above)HTMLOptionElementinterface specSince you’re using jQuery, however, there’s a better way to construct elements.
I’m not sure what the last
trueargument should do – at least in Chrome,new Option('text', 'value', true, true)seems to return the same thing asnew Option('text', 'value', true).