I’m attempting to append an item to my jquery select like so…
but it doesn’t appear to be working. could anyone tell me what I’m doing wrong? If it’s at all relevant I’m testing on Chrome.
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.
You didn’t select jQuery in jsFiddle, you were using MooTools so it is not surprising that your jsfiddle doesn’t work.
I’ve fixed it here: http://jsfiddle.net/5sWCp/1/
Also notice that you should use
$("<option>").attr("value", msg)and not$("option").attr("value", msg)as you did in your initial fiddle. So here’s the final version: