Reputation: 1677
this works ..
$("select[title='First Choice'] option[text='hello']").remove();
A number of variations of this does not .. i know this is stupid.
var what='hello';
$("select[title='First Choice'] option[text=$what]").remove();
also tried these.
$("select[title='First Choice'] option[text=$(what)]").remove();
$("select[title='First Choice'] option[text='$what']").remove();
$("select[title='First Choice'] option[text=$what.val()]").remove();
Upvotes: 0
Views: 1331
Reputation: 21565
You want this:
$("select[title='First Choice'] option[text=" + what + "]").remove();
Upvotes: 6