victorwesterlund.com/public/assets/js/search.mjs
Victor Westerlund 54da8f9be2
Add back-end core and "search" feature (#20)
Soft initial release of API core and "search" feature.
2021-11-03 11:10:50 +01:00

9 lines
No EOL
369 B
JavaScript

import { default as Search } from "./modules/Search.mjs";
const searchBox = document.getElementById("search")?.getElementsByTagName("input")[0] ?? false;
const resultsContainer = document.getElementById("results");
new Search(searchBox,resultsContainer);
// Set focus on searchbox when typing from anywhere
window.addEventListener("keydown",() => searchBox.focus());