【发布时间】:2012-03-29 16:33:44
【问题描述】:
这行得通..
$("select[title='First Choice'] option[text='hello']").remove();
这有很多变体……我知道这很愚蠢。
var what='hello';
$("select[title='First Choice'] option[text=$what]").remove();
也试过这些。
$("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();
【问题讨论】:
-
这是 javascript,而不是 php...这些类型的文本替换甚至不适用。您需要手动插入字符串。
标签: javascript jquery string-concatenation