我有一個元素選擇一個問題,我有一個表格,我想運行每個窗體select
箱each
功能,這裏是我的代碼:jQuery的選擇元素錯誤
$("#profile_form select").each(function(i){
var seen = {};
$(this + 'option').each(function() {
var txt = $(this).text();
if (seen[txt])
$(this).remove();
else
seen[txt] = true;
});
});
現在我的問題是$(this + 'option')
部分,如果我嘗試只選擇它工作正常選擇菜單,但我需要選擇option
,如果我這樣做,我得到:
Uncaught Error: Syntax error, unrecognized expression: [object HTMLSelectElement]option
我到底做錯了什麼?
謝謝你,它的工作 – Linas 2012-03-19 22:18:53