I need to update an option text and I do not have #id of the select box.
I found examples like this:
$('#selectid option:contains("OLD_TEXT_VALUE")').text('newtext');
I can't use this example, since I can only access select like this:
selectedField.find('select')
how do I add
option:contains("OLD_TEXT_VALUE")').text('newtext');
to the above way of selecting select, is it possible?
This is my code, there can be many selects dynamically inserted into the page in this format.
<div id="basic_select_xxxx" class="form-group selectable">
<select class="form-control">
<option>Select something</option>
</select>
</div>
I can select the select only like this:
$('#basic_select_xxxx').find('select).
how to then update select option with new text by looking up the old value? Is it possible this way? I can not put id on select, so let me know if there is other way?
one selectin the whole page?selectedField