Jquery to iterate through a list

niexba

New Member
Following jQuery is not working on given select box.I want to iterate through all the options of select box.Where am I going wrong?Am not getting \[code\]alert("hi")\[/code\], I.E. \[code\]$("#FileType").find('x:option').each(function(){\[/code\] is not executing.\[code\]<x:select id="FileType" width="210px"> <x:option value="http://stackoverflow.com/questions/15611201/JPG">JPG</x:option> <x:option value="http://stackoverflow.com/questions/15611201/PNG">PNG</x:option> <x:option value="http://stackoverflow.com/questions/15611201/PDF">PDF</x:option> <x:option value="http://stackoverflow.com/questions/15611201/TIF">TIF</x:option> <x:option value="http://stackoverflow.com/questions/15611201/BMP">BMP</x:option></x:select>$("#FileType").find('x:option').each(function(){ alert("hi"); if($(this).val() == AttachmentExtension) $("#FileType").val(AttachmentExtension);});\[/code\]
 
Back
Top