input search picture jquery
JavaScript
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="live-search" method="post">
<fieldset>
<input type="text" class="text-input" id="filter" />
<span id="filter-count"></span>
</fieldset>
</form>
<br/>
<br/>
<div id="gallery">
<div class="item #1 Category-Home Home">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x151" />
</a>
</div>
<div class="item #2 Category-Kitchen Kitchen">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x152" />
</a>
</div>
<div class="item #3 Category-Outdoors Outdoors">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x153" />
</a>
</div>
<div class="item #4 Category-Sports Sports">
<a id="#image-link" target="_blank" a href="">
<img class="img_item"><img src="http://placehold.it/150x154" />
</a>
</div>
</div>$(document).ready(function() {
var images = $(".item") //contain all unfiltered images
$("#filter").on("change paste keyup", function(){
$.each(images, function(i, l){
$(l).hide();
}); //hide all images
searchValue = $("#filter").val(); //get entered value of input field
searchValueRE = new RegExp(searchValue, "i"); //convert search value into RegExp
output = $.grep(images, function (n) {return searchValueRE.test(n.className); }); //Returns array that matches input value
$.each(output, function(i, l){
$(l).show();
}); //show matched images
});
});
Also in JavaScript:
- Title
- clone object in js
- Category
- JavaScript
- Title
- fix your timestep javascript
- Category
- JavaScript
- Title
- get current directory vbscript
- Category
- JavaScript
- Title
- auto refresh page javascript
- Category
- JavaScript
- Title
- how to delete element in list javascript
- Category
- JavaScript
- Title
- getboundingclientrect() javascript
- Category
- JavaScript
- Title
- window location in react
- Category
- JavaScript
- Title
- how to find out what a string ends with in javascript
- Category
- JavaScript
- Title
- convert object to json javascript
- Category
- JavaScript
- Title
- how to javascript
- Category
- JavaScript
- Title
- disabling submit button until all fields have values
- Category
- JavaScript
- Title
- definicion de un componente en angular
- Category
- JavaScript
- Title
- hoisting in javascript
- Category
- JavaScript
- Title
- changing columns for table requires doctrine dbal install doctrine/dbal
- Category
- JavaScript
- Title
- how to make a factorial function in javascript
- Category
- JavaScript
- Title
- get value of all checked boxes jquery
- Category
- JavaScript
- Title
- Add table row in jQuery
- Category
- JavaScript
- Title
- how to remove session data on tab close in redux\
- Category
- JavaScript
- Title
- how to program an array in js
- Category
- JavaScript
- Title
- angular sumar labels
- Category
- JavaScript
- Title
- delete last element of array js
- Category
- JavaScript
- Title
- get radio button value javascript
- Category
- JavaScript
- Title
- how to animate a flash in jquery
- Category
- JavaScript
- Title
- how to initialize an array in javascript
- Category
- JavaScript
- Title
- angularjs socket.io
- Category
- JavaScript
- Title
- console.log in jsx
- Category
- JavaScript
- Title
- add 2 class names react
- Category
- JavaScript
- Title
- how to create duplicate key array in javascript
- Category
- JavaScript
- Title
- add class javascript
- Category
- JavaScript
- Title
- Javascript compare two objects
- Category
- JavaScript
- Title
- fixed div with scrollable content
- Category
- JavaScript
- Title
- get month in two digit in javascript date
- Category
- JavaScript
- Title
- compare two arrays javascript
- Category
- JavaScript
- Title
- how to set up a json file
- Category
- JavaScript
- Title
- how to turn decimales into percents with javascript
- Category
- JavaScript
- Title
- get a element using name in jquery
- Category
- JavaScript
- Title
- get screen width javascript
- Category
- JavaScript
- Title
- How to uninstall npm modules in node js?
- Category
- JavaScript
- Title
- for of loop syntax javascript
- Category
- JavaScript
- Title
- codemirror get object from textarea
- Category
- JavaScript
- Title
- how to load localt ext file in js
- Category
- JavaScript
- Title
- how to get the value in a tag in react
- Category
- JavaScript
- Title
- get the current url javascript
- Category
- JavaScript
- Title
- how to add element in json object
- Category
- JavaScript
- Title
- document ready
- Category
- JavaScript
- Title
- javascript add element to serialized form array
- Category
- JavaScript
- Title
- group by in javascript
- Category
- JavaScript
- Title
- client side redirect javascript
- Category
- JavaScript
- Title
- clone javascript object
- Category
- JavaScript
- Title
- check window resize javascript
- Category
- JavaScript
- Title
- how to push object in array using for loop javascript
- Category
- JavaScript
- Title
- free map js
- Category
- JavaScript
- Title
- console.log('Hi there!');
- Category
- JavaScript
- Title
- convert json to 2d array
- Category
- JavaScript
- Title
- Encoding and Decoding Base64 Strings in Node.js
- Category
- JavaScript
- Title
- how to make dynamic columns in jquery
- Category
- JavaScript
- Title
- how to run p5js in a particular section of page
- Category
- JavaScript
- Title
- convert json to csv npm
- Category
- JavaScript
- Title
- append element javascript
- Category
- JavaScript
- Title
- how to concatenate strings javascript
- Category
- JavaScript
- Title
- Alternating Sums
- Category
- JavaScript
- Title
- document delete element
- Category
- JavaScript
- Title
- addEventListener
- Category
- JavaScript
- Title
- for function js
- Category
- JavaScript
- Title
- html to jsx
- Category
- JavaScript
- Title
- How to copy text from a div to clipboard
- Category
- JavaScript
- Title
- delete previous line node
- Category
- JavaScript
- Title
- if clicked outside of div jquery
- Category
- JavaScript
- Title
- code to launch browser using javascript
- Category
- JavaScript
- Title
- Angular watching for changes in $http.pendingRequests from directive
- Category
- JavaScript
- Title
- how to code print in javascript
- Category
- JavaScript
- Title
- how to validate the radio button using jquery
- Category
- JavaScript
- Title
- how to read json file in python
- Category
- JavaScript
- Title
- document get element by tag
- Category
- JavaScript
- Title
- how to add object to array javascript
- Category
- JavaScript
- Title
- best way to filter table in angular
- Category
- JavaScript
- Title
- clear scene\
- Category
- JavaScript
- Title
- count occurrences of character in string javascript
- Category
- JavaScript
- Title
- grapejs html editor
- Category
- JavaScript
- Title
- for loop javascript
- Category
- JavaScript
- Title
- background-image url not working
- Category
- JavaScript
- Title
- input in javascript
- Category
- JavaScript
- Title
- how to set three js canvas width 100%
- Category
- JavaScript
- Title
- hackerrank fizzbuzz javascript
- Category
- JavaScript
- Title
- how to expire a cookie in javascript
- Category
- JavaScript
- Title
- how to remove item from array javascript
- Category
- JavaScript
- Title
- how to split two digit number in javascript
- Category
- JavaScript
- Title
- graal.js javascript array in java
- Category
- JavaScript
- Title
- angular build production
- Category
- JavaScript
- Title
- enter event in jquery
- Category
- JavaScript
- Title
- how to add data-toggle and data-target using jquery
- Category
- JavaScript
- Title
- how to english paragraph matching in javascript
- Category
- JavaScript
- Title
- how to save thing in cookie js
- Category
- JavaScript
- Title
- faker js
- Category
- JavaScript
- Title
- array.filter in js
- Category
- JavaScript
- Title
- eyeshot javascript version
- Category
- JavaScript
- Title
- how to remove a property from an object in javascript
- Category
- JavaScript
- Title
- express json body
- Category
- JavaScript
- Title
- foreach and replace item based on condition
- Category
- JavaScript
- Title
- get a div text content and store in a variable js
- Category
- JavaScript