selected/selected.js
function(ev) {
            var regex = new RegExp(searchBox.value, 'i'),
                targets = optionsList.querySelectorAll('li');

            for (var i=0; i<targets.length; i++) {
                var target = targets[i];

                // With multiple active options are never shown in the options list, with single
                // we show both the active/inactive options with the active highlighted
                if(multiple && target.classList.contains('active'))
                    continue;

                if(!target.textContent.match(regex)) {
                    target.style.display = 'none';
                } else {
                    target.style.display = 'block';
                }
            };

            searchBox.style.width = ((searchBox.value.length * selected.textWidth) + 25) + 'px';
            moveOptionList();
        }
function(ev) {
            var regex = new RegExp(searchBox.value, 'i'),
                targets = optionsList.querySelectorAll('li');

            for (var i=0; i<targets.length; i++) {
                var target = targets[i];

                // With multiple active options are never shown in the options list, with single
                // we show both the active/inactive options with the active highlighted
                if(multiple && target.classList.contains('active'))
                    continue;

                if(!target.textContent.match(regex)) {
                    target.style.display = 'none';
                } else {
                    target.style.display = 'block';
                }
            };

            searchBox.style.width = ((searchBox.value.length * selected.textWidth) + 25) + 'px';
            moveOptionList();
        }
function ( ev ) { var regex = new RegExp ( searchBox . value , 'i' ) , targets = optionsList . querySelectorAll ( 'li' ) ; for ( var i = 0 ; i < targets . length ; i ++ ) { var target = targets [ i ] ; // With multiple active options are never shown in the options list, with single // we show both the active/inactive options with the active highlighted if ( multiple && target . classList . contains ( 'active' ) ) continue ; if ( ! target . textContent . match ( regex ) ) { target . style . display = 'none' ; } else { target . style . display = 'block' ; } } ; searchBox . style . width = ( ( searchBox . value . length * selected . textWidth ) + 25 ) + 'px' ; moveOptionList ( ) ; }
Filter options list by searchbox results
Filter options list by searchbox results