In a perfect world (Firefox) I could just use the .toggle option and be done with it. However, IE and Chrome aren’t able to access option elements. By using .wrap(”), I am able to successfully hide in all browsers.
$(document).ready(function () {
$('#lstAvailRates option').wrap('<span>').hide();
$('#btnToggle').click(function () {
$('#lstAvailRates option').unwrap('<span>').show();
});
});
Ideally, I would like #btnToggle to be able to toggle show/hide. However, I’m having issues figuring out the correct flow.
MC
You could do
fiddle here http://jsfiddle.net/GX68J/