This commit is contained in:
Thomas Chartron 2021-11-04 23:55:27 +01:00
parent 42623295bc
commit 94807c5623
2 changed files with 2 additions and 5 deletions

View file

@ -1,13 +1,10 @@
document.addEventListener("DOMContentLoaded", function() {
// ---------------- Selected
let navbar_links = document.querySelector('#nav-links').children;
let current_location = window.location.href;
let selected_navbar_link = [...navbar_links].find((item) => {
return (item.href === current_location)
})
selected_navbar_link.className = "bg-gray-900 text-white px-3 py-2 rounded-md text-sm font-medium"
// for (let i = 0; i <= navbar_links.length; i++) {
// if (document.querySelector('#nav-links').children)
// }
console.log(selected_navbar_link);
});

View file

@ -3,5 +3,5 @@ document.addEventListener("DOMContentLoaded", function() {
});
function search() {
console.log('search')
}