I know one can get the value of the currently selected item like this:
var myListBoxItemText = $('#myListBox').val().toString();
But how do you change this value in the list box to something else?
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.
Seeing your update in the comments, here’s an updated answer. Just use the
:selectedselector to filter the options inside of yourselectelement to get the selected option.To change a
selectelement’s selected option’svalueproperty:To change its display text:
JSFiddle