Jquery to iterate through a list
<p>Following jQuery is not working on given select box.</p>

<p>I want to iterate through all the options of select box.</p>

<p>Where am I going wrong?</p>

<p>Am not getting <code>alert("hi")</code>, I.E. <code>$("#FileType").find('x:option').each(function(){</code> is not executing.</p>

<pre><code>&lt;x:select id="FileType" width="210px"&gt;
        &lt;x:option value="JPG"&gt;JPG&lt;/x:option&gt;
        &lt;x:option value="PNG"&gt;PNG&lt;/x:option&gt;
        &lt;x:option value="PDF"&gt;PDF&lt;/x:option&gt;
        &lt;x:option value="TIF"&gt;TIF&lt;/x:option&gt;
        &lt;x:option value="BMP"&gt;BMP&lt;/x:option&gt;
&lt;/x:select&gt;

$("#FileType").find('x:option').each(function(){
    alert("hi");                                
    if($(this).val() == AttachmentExtension)
    $("#FileType").val(AttachmentExtension);
});
</code></pre>
