Drop down box selectedIndex property
<pre><code>$.fn.fillSelect = function (data) {
    return this.clearSelect().each(function () {
        if (this.tagName == 'SELECT') {
            var dropdownList = this;
            $.each(data, function (index, optionData) {
                var option = new Option(optionData.Text, optionData.Value);
                if ($.browser.msie) {
                    dropdownList.add(option);
                } else {
                    dropdownList.add(option, null);
                }
            });
            // code for access "selectedindex" 
        }
    });
};
</code></pre>

<p>Above is the code snippet for dynamically generating a drop down using jQuery.</p>

<p>I need to set <strong>selectedIndex</strong> property value dynamically for the purpose of showing the saved value earlier. I am going to insert that code into <code>// code for access "selectedindex"</code> place inside above code. So how can I set <strong>selectedIndex</strong> property for the <code>dropdownList</code>?</p>
