0
Drop down menu
So I spent a looong time to get a dropdown menu with pure JavaScript but it wasn't working. So I used jquery. Pls can someone create a dropdown with the html code below using pure JavaScript? It won't take a lot of time for you guys. Thanks https://code.sololearn.com/W8rYlTdk0mA9/?ref=app
1 Antwort
+ 5
window.onload = function() {
document.getElementById("btn").addEventListener("click", function() {
clicked()
}, true)
}
function clicked() {
var menu = document.getElementById("menu")
if(menu.classList.contains("menuToggle")) {
menu.classList.remove("menuToggle");
return;
}
menu.classList.add("menuToggle");
}