I have a select list that displays list languages.
<select name="language_code" id="id_language_code">
<option value="ar">Arabic - العربية</option>
<option value="bg">Bulgarian - </option>
<option value="zh-CN">Chinese (Simplified) - 中文 (简体)</option>
<option value="en" selected="selected">English (US)</option>
<option value="fr-CA">French (Canada) - français (Canada)</option>
</select>
I can get the text value of the selected value using the following code [returns English (US) from the above selection list]:
$('#id_language_code option:selected').text()
How to get a text value if I pass the value of the 'bg' parameter as a variable when the selected value is still in English (USA)?
This means that the return value will be "Bulgarian - Bulgarian" when the selected value is still "English (USA)".
I searched Google and SO for an answer, but could not find it, so I think it is not as easy as I thought it was!