I have a dropdown as follows:
<select id="select_Boiler"> <option value="boiler_1645">Vaillant 831</option> <option value="boiler_2373">Worcester 24</option> <option value="boiler_3009">Vaillant 835</option> <option value="boiler_4354">Bosch 671</option> </select>
I need to remove certain options using jQuery, but based on the text, not the parameter value. I tried this without success:
jQuery("#select_Boiler option[text='Vaillant 835']").remove();
I know that I can do the same with the value as shown below and it works, but I need to do it by text
jQuery("#select_Boiler option[value='boiler_3009']").remove();
source share