Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // filter Tasks
- function filterTasks(e) {
- const text = e.target.value.toLowerCase();
- document.querySelectorAll('.collection-item').forEach(function(task) {
- const item = task.firstChild.textContent;
- if (item.toLowerCase().indexOf(text) != -1) {
- task.style.display = 'block';
- } else {
- task.style.display = 'none';
- }
- });
- }
Add Comment
Please, Sign In to add comment