I have a dropdownlist having id="ddlTitle".
It contains three values as mentioned below
Mr.
Mrs.
Miss
Current selected item is Mr. I want to change the selected text to some other text of dropdownlist when page refresh.
I am using $('#' + ddlTitle + ' :selected').text(Title); where Title can be Mr. or Mrs. or Miss
There is one problem that if I use the above code, I am able to change the selected text but whatever was the selected text before, didn't appear in dropdownlist.
Example : If current selected text is Mr. then after using this code $('#' + ddlTitle + ' :selected').text('Miss'); Current selected text will become Miss but values in dropdownlist becomes as below:
Miss
Mrs.
Miss
Where as previous values were
Mr.
Mrs.
Miss