📅  最后修改于: 2022-03-11 15:03:45.279000             🧑  作者: Mango
let toggleBtn = document.querySelector("#navbar-toggle");
let collapse = document.querySelector("#navbar-collapse");
toggleBtn.onclick = () => {
collapse.classList.toggle("hidden");
collapse.classList.toggle("flex");
};