嗨,夥計們,我在JQuery中有以下代碼,其中我基本上創建了一個新的選擇,然後當我嘗試找到它時,我無法找到它。請指點做了附加後無法找到Jquery中的元素
var parent = optionElement.parent();
var strHTML = "";
var tempClass = optionElement.attr("class");
strHTML = "<select name='" + optionElement.attr("name") + "' id='" + optionElement.attr("id") + "' class ='" + optionElement.attr("class") + "' >" + GetSearchOptionFilteredData(sOpt, true) + "</select>";
optionElement.remove();
parent.append(strHTML);
**alert(parent.find(tempClass).length); <-- this gives 0**
我傻,感謝奏效 – Amit