I have had a close button using the foundation Toggler
https://get.foundation/sites/docs/toggler.html
How in JS could i do something to the DOM when the close button is clicked?
I have tried something like this:
function handleToggler() {
console.log('closing the panel');
}
window.addEventListener(
'on.zf.toggler',
handleToggler,
);
But this is not it.
You can add an onclick to the html:
<a data-toggle="menuBar" onclick="yourFunctionHere()">Expand!</a>
Then just access the DOM node you want to do something to in the function:
function yourFunctionHere(e){
const a_div = document.getElementById("a_div");
}