Created
December 7, 2017 01:56
-
-
Save daniloparrajr/9a220f5a2c5b38c1d48064dda8ccd70b to your computer and use it in GitHub Desktop.
show and hide select tag option depending on filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment