6
Ich habe ein Element auswählen.von jquery, auf Option von HTML-Select-Element ausgewählt ATRIBUDE durch Text, nicht Wert
$('.cSelectType option[value=4]').attr('selected', 'selected');
und wählen Element wird "Four":
<select class='cSelectType'>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
</select>
i von jquery gesetzt Optionswert kann wie folgt ausgewählt. Indem ich nicht etwas wie das tun werde:
$('.cSelectType option[xxx=Four]').attr('selected', 'selected');
d. H. Durch Text gesetztes vorgewähltes Attribut.
einige Ideen bitte.