bookmarks/js/bookmarks.js
2020-09-01 22:25:42 +02:00

11 lines
368 B
JavaScript

document.addEventListener('DOMContentLoaded', (event) => {
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$('#content h2').show().filter(function() {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
});
});