With this<select>
<select id="idselect">
<option value="1" data-msg="111">Personalizado</option>
</select>
To change the option to a <select>
in jquery I have for example these options
$('#idselect').val('1').attr('selected','selected')
$('#idselect > option[value="1"]').attr('selected','selected')
$('#idselect > option[data-msg="111"]').attr('selected','selected')
But it is with value
or custom attributes
I would like to know how the option can be changed by indicating the text 'Custom' and not by any attribute.
You can use the :contains() selector to check the text inside the
<option>
.I leave you an example, the heart of the matter is in the use of the jQuery selector
contains