jQuery not working in Internet Explorer 11 when dealing with <select><option>
<p><strong>UPDATE: AT this point I am able to open the subjects in IE-11 but not close.  The spans are not being placed back on the objects to handle the display:none.</strong></p>

<p>Why am I not able to select a specific option with jQuery when I am forced to use IE?</p>

<p>In a SELECT I have a list of 'Subjects' (OPTION's) and under each 'Subject' there are 'Courses'.  </p>

<p>All of these are OPTION's are setup with class of '.subject' or '.course'</p>

<p>When the page loads it should show ONLY the 'Subjects' and when a 'Subject' is clicked it should accordion open to display all of the 'Courses' that are part of that 'Subject'.  When clicking that same 'Subject' it should close the 'Subject'.  If a different 'Subject' is clicked, it should close all 'Subjects' and then open the newly clicked 'Subject'.</p>

<p>Simplified question being, what is the best way of using jQuery to access a select option when it is clicked since IE does not allow options to be set as the selector?</p>

<p><a href="https://jsfiddle.net/tsoheili/7p222pur/16/" rel="nofollow">JSFIDDLE</a></p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
        $(document).ready(function() {
function showCourses(i) {
    //hideCourses();
    $('.subject.subject-' + i).addClass('open');
    $('.course.subject-' + i).toggleOption(true);
    $('.child.subject-' + i).toggleOption(true);
}
// function hideCourses() {
//  $('#selectable_box .course').toggleOption(false);
//  $('#selectable_box .child').toggleOption(false);
//  $('.open').removeClass('open');
// }
// function hideCourses(i) {
//  $('#selectable_box .course.subject-' + i).toggleOption(false);
//  $('#selectable_box .child.subject-' + i).toggleOption(false);
//  $('.open').removeClass('open');
// }

function showSubjects(i) {
    var link = '.subject.subject-' + i;
    var content = '.subject-' + i;
    // hideCourses();
    // hideCourses(i);
}

var numSubjects = $('.subject').length;

for(var i = 1; i &lt;= numSubjects; i++) {
    showSubjects(i);
}

function Redirect() {
    //window.location="https://www.bwreporting.net/index.php?option=com_bwreporting&amp;view=report&amp;Itemid=412&amp;uid={$uid}&amp;zk=11zCfScZtD2ms9LyBZ4UySgYH";
    var cus_url ='{$page_url}{$report_details-&gt;custom_page_url_1}';
    console.log(cus_url);
    //window.top.location.href=cus_url;
}

function AddCourses(){
    //setTimeout('Redirect()', 500);
    var cus_url ='{$page_url}{$report_details-&gt;custom_page_url_1}';
    window.top.location.href=cus_url;

}

function SelectAllItems() {
    var valArray = [];

    $("#selected_box  option").each(function () {
    txtVal = $(this).text();
    valArray.push({title:txtVal,loid:$(this).val()});
    });
    $('#hidden1').val(JSON.stringify(valArray));
}

//Method to handle displaying and not displaying courses when the subjects are clicked.
jQuery.fn.toggleOption = function( show ) {
    jQuery( this ).toggle( show );
    if( show ) {
        if( jQuery( this ).parent( 'span.toggleOption' ).length )
            jQuery( this ).unwrap( );
    } else {
        if( jQuery( this ).parent( 'span.toggleOption' ).length == 0 )
            jQuery( this ).wrap( '&lt;span class="toggleOption" style="display: none;" /&gt;' );
    }
};
//jQuery(selector).toggleOption(true); // show option
//jQuery(selector).toggleOption(false); // hide option

$('#selectable_box option.course').toggleOption(false);
$('#selectable_box option.child').toggleOption(false);

var options = $("#selectable_box :selected");
var lastOption;
var subj_id;
var i;
var open;
var len;

$("#selectable_box").click(function()
{
    lastOption = $(this).find(':selected').not(options);
    options = $(this).find(':selected');

    subj_id = options.attr('class');
    end = subj_id.length;
    start = end - 4;

    open = subj_id.substring(start, end);

    if(subj_id != '' || subj_id != 'undefined') {
        if(open == 'open') {
            $('#selectable_box option.course').toggleOption(false);
        $('#selectable_box option.child').toggleOption(false);
        $('.open').removeClass('open');
        // hideCourses();
        }else{
            i = subj_id.replace('subject subject-', '');
            $('#selectable_box option.course').toggleOption(false);
        $('#selectable_box option.child').toggleOption(false);
        $('.open').removeClass('open');
            showCourses(i);
        }
    }else{
        $('#selectable_box option.course').toggleOption(false);
    $('#selectable_box option.child').toggleOption(false);
    $('.open').removeClass('open');
    }

});
&lt;/script&gt;



    &lt;form name='submit' id='myFormId' method='post' onsubmit='AddCourses()' enctype='multipart/form-data'&gt;
    &lt;div id='main_content'&gt;
    &lt;div class='heading-row'&gt;
&lt;div class='heading-right' id='bypassme'&gt;&lt;span id='buttonDiv'&gt;
&lt;div id='list' style='width:465px;float:left'&gt;
&lt;div class='header'&gt;Select Courses &lt;span class='small'&gt;(Up to 30)&lt;/span&gt;&lt;/div&gt;&lt;select style="width:300px;height : 300px" multiple="multiple" name="selectable_box" id="selectable_box"&gt;
&lt;option class="subject subject-1" value=""&gt;Subject One&lt;/option&gt;
&lt;option data-key="1" subj-id="1" class="course subject-1" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="1" class="course subject-1" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="1" class="course subject-1" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="1" class="course subject-1" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="5" subj-id="1" class="course subject-1" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="6" subj-id="1" class="course subject-1" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="7" subj-id="1" class="course subject-1" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option class="subject subject-2" value=""&gt;Subject Two&lt;/option&gt;
&lt;option data-key="1" subj-id="2" class="course subject-2" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="2" class="course subject-2" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="2" class="course subject-2" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="2" class="course subject-2" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="5" subj-id="2" class="course subject-2" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="6" subj-id="2" class="course subject-2" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="7" subj-id="2" class="course subject-2" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option data-key="8" subj-id="2" class="course subject-2" value="" style=""&gt;Course 8&lt;/option&gt;
&lt;option data-key="9" subj-id="2" class="course subject-2" value="" style=""&gt;Course 9&lt;/option&gt;
&lt;option data-key="10" subj-id="2" class="course subject-2" value="" style=""&gt;Course 10&lt;/option&gt;
&lt;option data-key="11" subj-id="2" class="course subject-2" value="" style=""&gt;Course 11&lt;/option&gt;
&lt;option data-key="12" subj-id="2" class="course subject-2" value="" style=""&gt;Course 12&lt;/option&gt;
&lt;option data-key="13" subj-id="2" class="course subject-2" value="" style=""&gt;Course 13&lt;/option&gt;
&lt;option data-key="14" subj-id="2" class="course subject-2" value="" style=""&gt;Course 14&lt;/option&gt;
&lt;option data-key="15" subj-id="2" class="course subject-2" value="" style=""&gt;Course 15&lt;/option&gt;
&lt;option class="subject subject-3" value=""&gt;Subject Three&lt;/option&gt;
&lt;option data-key="1" subj-id="3" class="course subject-3" value="" style=""&gt;"Course 1"&lt;/option&gt;
&lt;option class="subject subject-4" value=""&gt;Subject Four&lt;/option&gt;
&lt;option data-key="1" subj-id="4" class="course subject-4" value="" style=""&gt;"Course 1"&lt;/option&gt;
&lt;option data-key="2" subj-id="4" class="course subject-4" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="4" class="course subject-4" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="4" class="course subject-4" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="5" subj-id="4" class="course subject-4" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="6" subj-id="4" class="course subject-4" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="7" subj-id="4" class="course subject-4" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option data-key="8" subj-id="4" class="course subject-4" value="" style=""&gt;Course 8&lt;/option&gt;
&lt;option data-key="9" subj-id="4" class="course subject-4" value="" style=""&gt;Course 9&lt;/option&gt;
&lt;option data-key="10" subj-id="4" class="course subject-4" value="" style=""&gt;Course 10&lt;/option&gt;
&lt;option data-key="11" subj-id="4" class="course subject-4" value="" style=""&gt;Course 11&lt;/option&gt;
&lt;option data-key="12" subj-id="4" class="course subject-4" value="" style=""&gt;Course 12&lt;/option&gt;
&lt;option data-key="13" subj-id="4" class="course subject-4" value="" style=""&gt;Course 13&lt;/option&gt;
&lt;option data-key="14" subj-id="4" class="course subject-4" value="" style=""&gt;Course 14&lt;/option&gt;
&lt;option data-key="15" subj-id="4" class="course subject-4" value="" style=""&gt;Course 15&lt;/option&gt;
&lt;option data-key="16" subj-id="4" class="course subject-4" value="" style=""&gt;Course 16&lt;/option&gt;
&lt;option data-key="17" subj-id="4" class="course subject-4" value="" style=""&gt;Course 17&lt;/option&gt;
&lt;option data-key="18" subj-id="4" class="course subject-4" value="" style=""&gt;Course 18&lt;/option&gt;
&lt;option data-key="19" subj-id="4" class="course subject-4" value="" style=""&gt;Course 19&lt;/option&gt;
&lt;option data-key="20" subj-id="4" class="course subject-4" value="" style=""&gt;Course 20&lt;/option&gt;
&lt;option class="subject subject-5" value=""&gt;Subject Five&lt;/option&gt;
&lt;option data-key="1" subj-id="5" class="course subject-5" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option class="subject subject-6" value=""&gt;Subject Six&lt;/option&gt;
&lt;option data-key="1" subj-id="6" class="course subject-6" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="6" class="course subject-6" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="6" class="course subject-6" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="6" class="course subject-6" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="5" subj-id="6" class="course subject-6" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="6" subj-id="6" class="course subject-6" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="7" subj-id="6" class="course subject-6" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option data-key="8" subj-id="6" class="course subject-6" value="" style=""&gt;Course 8&lt;/option&gt;
&lt;option data-key="9" subj-id="6" class="course subject-6" value="" style=""&gt;Course 9&lt;/option&gt;
&lt;option data-key="10" subj-id="6" class="course subject-6" value="" style=""&gt;Course 10&lt;/option&gt;
&lt;option data-key="11" subj-id="6" class="course subject-6" value="" style=""&gt;Course 11&lt;/option&gt;
&lt;option data-key="12" subj-id="6" class="course subject-6" value="" style=""&gt;Course 12&lt;/option&gt;
&lt;option data-key="13" subj-id="6" class="course subject-6" value="" style=""&gt;Course 13&lt;/option&gt;
&lt;option data-key="14" subj-id="6" class="course subject-6" value="" style=""&gt;Course 14&lt;/option&gt;
&lt;option class="subject subject-7" value=""&gt;Subject Seven&lt;/option&gt;
&lt;option data-key="1" subj-id="7" class="course subject-7" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="7" class="course subject-7" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="7" class="course subject-7" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="7" class="course subject-7" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="5" subj-id="7" class="course subject-7" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="6" subj-id="7" class="course subject-7" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="7" subj-id="7" class="course subject-7" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option class="subject subject-8" value=""&gt;Subject Eight&lt;/option&gt;
&lt;option data-key="1" subj-id="8" class="course subject-8" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="8" class="course subject-8" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="8" class="course subject-8" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="8" class="course subject-8" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option class="subject subject-9" value=""&gt;Subject Nine&lt;/option&gt;
&lt;option data-key="1" subj-id="9" class="course subject-9" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="2" subj-id="9" class="course subject-9" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="3" subj-id="9" class="course subject-9" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="4" subj-id="9" class="course subject-9" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option class="subject subject-10" value=""&gt;Subject Ten&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child One&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child Two&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child Three&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child Four&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child Five&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 3&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 4&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 5&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 6&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 7&lt;/option&gt;
&lt;option class="child subject-10" value=""&gt;Child Six&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 1&lt;/option&gt;
&lt;option data-key="1" subj-id="10" class="course subject-10" value="" style=""&gt;Course 2&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;div style='min-width:65px;float:left'&gt;&amp;nbsp;&lt;button id='add' type='button' style='cursor:default;' title='Add' class='gen_btn'&gt;&amp;nbsp;&lt;/button&gt;&lt;button id='remove' type='button' style='cursor:default;' title='Remove' class='gen_btn' &gt;&amp;nbsp;&lt;/button&gt;&lt;/div&gt;
&lt;div id='list' style='width:465px;float:left'&gt;
&lt;div class='header'&gt;Your Queue &lt;input type='submit' name='submit' class='gen_btn' value='Save Queue &amp; Generate Report' onmouseover='SelectAllItems()'&gt;&lt;/div&gt;
&lt;select style="width:300px;" multiple="mutiple" name="selected_box" id="selected_box"&gt;

&lt;/select&gt;
&lt;/div&gt;
&lt;div style='margin:50px;width:465px;float:left'&gt;&lt;input type='hidden' id='hidden1' name='hidden1[]' value='' /&gt;&lt;input type='hidden' id='sneak' name='sneak' value='1' /&gt;&lt;/div&gt;&lt;br style='clear:both;'&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class='cat-list-row'&gt;
&lt;div class='heading-left'&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt; 
</code></pre>