Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

search content in js

// Programmed by RIMON, the programming king!
const $_ = {
  e:function(e) {return document.querySelector(e)},
  ea:function(e) {return document.querySelectorAll(e)},
}
const si = $_.e('#search-todos');
si.oninput=function(){_search_(this.value)};
function _search_(v) {
  var v_ = v.toLowerCase();
  const tds = $_.ea('#lists span');
  for(var i=0;i<tds.length;i++) {
    tds[i].parentElement.parentElement.style.display = 'none';
    var c_t = tds[i].innerHTML.toLowerCase();
    if(c_t.indexOf(v_) !== -1) {
      tds[i].parentElement.parentElement.style.display = 'block';
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: subtract two date javascript 
Javascript :: javascript check if elements of one array are in another 
Javascript :: check if a variable is a number in javascript 
Javascript :: check if function is async javascript 
Javascript :: javascript falsy values 
Javascript :: moment in react native 
Javascript :: javascript word count 
Javascript :: How to make the width of a react native element adjust according to the contents 
Javascript :: javascript format seconds into minutes and second 
Javascript :: follow cursor javascript 
Javascript :: js change button text 
Javascript :: detect two strings are anagram of each other in JavaScript 
Javascript :: javascript hover event 
Javascript :: angular maxlength directive input type number 
Javascript :: js history back 
Javascript :: how to capitalize a letter based on an index in javascript 
Javascript :: js close window 
Javascript :: jquery event element is visible 
Javascript :: what can i delete from create-react-app 
Javascript :: js code to remove class 
Javascript :: how to get custom attribute value in react 
Javascript :: javascript forever loop 
Javascript :: async storage has been extracted from react-native core 
Javascript :: ... array operator javascript 
Javascript :: clear localstorage on click jquery 
Javascript :: set css variable from javascript 
Javascript :: javascript reload page 
Javascript :: javascript check if dom element exists 
Javascript :: vue.js cdn script 
Javascript :: js `` 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =