After doing append not able to find the element in Jquery
<p>Hi Guys i have this below code in JQuery, where i basically create a new select on the fly and and then when i try to find it i cannot find it . Please advice</p>

<pre><code> var parent = optionElement.parent();
    var strHTML = "";
    var tempClass = optionElement.attr("class");

        strHTML = "&lt;select name='" + optionElement.attr("name") + "' id='" + optionElement.attr("id") + "' class ='" + optionElement.attr("class") + "' &gt;" + GetSearchOptionFilteredData(sOpt, true) + "&lt;/select&gt;";
        optionElement.remove();

        parent.append(strHTML);

    **alert(parent.find(tempClass).length); &lt;-- this gives 0**
</code></pre>
