<a href="example">Example</a>
function createContent() { ... }
function deleteContent() { ... }
const content = function () {
var isCreated = false
const this.change = function () {
if(isCreated) {
isCreated = false
...
} else {
isCreated = true
...
}
}
}
window.addEventListener("hashchange", (e) => {
document.querySelectorAll('.lang > a').forEach(el = el.classList.remove('active'));
switch(location.hash) {
case '#en': document.getElementById('lang-en').classList.add('active'); break;
case '#fr': document.getElementById('lang-fr').classList.add('active'); break;
default: break;
};
}, false);