Guest User

Untitled

a guest
Dec 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $(document).ready(function() {
  2. var search_box;
  3. search_box = $('#search');
  4. return search_box.bind('keyup', function() {
  5. var items;
  6. items = $('.item_link');
  7. return items.each(function() {
  8. var item, query;
  9. query = $('#search').val();
  10. item = $(this);
  11. if (query.length === 0) {
  12. return item.show();
  13. } else if (item.text().indexOf(query) === -1) {
  14. return item.hide();
  15. }
  16. });
  17. });
  18. });
Add Comment
Please, Sign In to add comment