jQuery .remove() option using :contains() -
at bottom of page line "step 2" opens accordion tab. on first section of interface 2nd drop down reads select servive.
im trying use :contains() , .remove() remove options contain word phone in text. here's code, doesn't seem work. error reads im missing closing ) cant see where.
<select class="ab-formelement ab-select-mobile ab-select-service"> <option value="">select service</option> <option value="1">early pregnancy scan</option> <option value="2">2d sexing / gender scan</option> <option value="18">phone booking > bundle of joy</option> </select> jquery(document).ready(function($){ $=jquery; var option = jquery('select.ab-select-service option:contains('phone')'); $(option).remove(); });
update: ive noticed else. try of elements within plugin seem not work. theres difference in syntax on jquery , code in scripts file.
you're nesting '
inside '
, prematurely terminating string. need escape nested '
\'
.
var option = jquery('select.ab-select-service option:contains(\'phone\')');
Comments
Post a Comment