I have a dropdown in a web page with 3830 elements in it. I know, excessive but whatever.
In jquery I get the selected option value using the statement:
$( "#institutionCombo :selected" ).val();
There is a noticeable pause before the selection is found. Once I get that value I insert it into a textbox on the page, so I know how fast. Plus I've checked it using breakpoints in Firebug.
If I go old school and use this javascript:
var div = document.getElementById( "maindiv" );
var select = div.getElementsByTagName( "select" )[ 0 ];
var ix = select.selectedIndex;
var instId = select.options[ ix ].value;
This speed is instananeous.
Is there something inherit in jquery that makes the :selected selector so slow when the numbers get too high? I'd like to stick with jquery throughout in my scripts, does anyone have a suggestion to speed up finding the selected option in jquery?
Thanks,
Craig