I have several Select which depend on each other if I select a value in one of the other is removed, and the previous value is added to others, how I can add the previous value by JQuery to Select? and then sort it alphabetically?
Share
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.
Not sure about the sorting (shouldn’t be too hard to figure out) but you can append an
<option>element to a list like this:The first call to
prop()is only if you need the element to be the selected one in the list, otherwise you can omit it.Edit: I went ahead and worked out the sort part: