danyaneh
12/7/2017 - 1:56 AM

Show / Hide select tag options - jQuery

show and hide select tag option depending on filter

var $selectTag = $('#selectTag');
var $selectOptions = $selectTag.find('option');
var $selectOptionsDetach = $('#selectTag option').detach();
// Only show the select option with the class of .option-filter-class
$selectTag.empty().append( $selectOptionsDetach.filter('.option-filter-class') );