Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js filter text

<script>
    $('input[name="search_field"]').on("keyup", function() {
        filtrate($(this).val().toLowerCase());
    });

    function filtrate(searched) {
        $(".filter-key > h3").filter(function() {
            var isHidden = ($(this).text().toLowerCase().indexOf(searched) > -1) ? 'block' : 'none';
            $('.filter-key').css('display', isHidden);
        });
    }
</script>
Comment

filter text js

$(document).ready(function(){
    var $btns = $('.btn').click(function() {
        if (this.id == 'all') {
          $('#parent > div').fadeIn(450);
        } else {
          var $el = $('.' + this.id).fadeIn(450);
          $('#parent > div').not($el).hide();
        }
        $btns.removeClass('active');
        $(this).addClass('active');
      })
    
    var $search = $("#search").on('input',function(){
        $btns.removeClass('active');
        var matcher = new RegExp($(this).val(), 'gi');
        $('.box').show().not(function(){
            return matcher.test($(this).find('.name, .skills').text())
        }).hide();
    })
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: nextjs check path 404 
Javascript :: find numeric Unicode value of the character with charCodeAt() method 
Javascript :: TypeError: (0 , import_dev.useParams) is not a function remix 
Javascript :: debounce getx 
Javascript :: call back filter 
Javascript :: vue mount modal to body 
Javascript :: Adding A Property To BuiltIn Class In Javascript 
Javascript :: how to run javascript in terminal 
Javascript :: × error: element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. you likely forgot to export your component from the file it 
Javascript :: shallow copy and deep copy in javascript 
Javascript :: empty array javascript 
Javascript :: password 
Javascript :: inertia.js 
Javascript :: javascript string return character 
Javascript :: hide and show div using javascript with example 
Javascript :: javascript add onclick to multiple elements 
Javascript :: first name last name concatenate javascript with ternary operator 
Javascript :: first element of array js 
Javascript :: javascript remove the last element from array 
Javascript :: unicode in javascript 
Javascript :: javascript function syntax 
Javascript :: spread operator react array 
Javascript :: angularjs select placeholder 
Javascript :: Default Parameter Values in javascript 
Javascript :: simple website with html css and javascript 
Javascript :: get sessionstorage value in jquery 
Javascript :: where to create service angularor nodejs 
Javascript :: select all checkbox in angular 
Javascript :: discord.js embed 
Javascript :: mouse wheel scroll sections in react 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =