I have a form
<select name="city" id="city"> <option value=0>Санкт-Питербург</option> <option value=1>Москва</option> </select>
To get a value using jQuery, you need to do this $ ('# city'). Val (); It's not a problem. And how can I get the very words of St. Petersburg, or Moscow, instead of the numbers 0 or 1?
Immediately say that you can not change anything in the form, and handle the type
if(this.value==0){alert('Спб');} else if(this.value==1){alert('Мск')}
too, because there can be more than 20 elements in the form, you cannot process everything, you need to directly get this label. Tell me how?