bookmarks/js/bookmarks.js

11 lines
368 B
JavaScript
Raw Permalink Normal View History

2020-09-01 22:25:42 +02:00
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();
});
});