365
edits
No edit summary |
No edit summary |
||
Line 60: | Line 60: | ||
function drawerExpand(x) { | function drawerExpand(x) { | ||
var y = x; //outputs something like "drawer-1" | var y = "drawer-".concat(x); //outputs something like "drawer-1" | ||
var z = document.getElementById(y); //outputs something like document.getElementById(" | var z = document.getElementById(y); //outputs something like document.getElementById("drawer-1") | ||
// | var a = "drawer-button".concat(x); //outputs something like "drawer-button-1" | ||
var b = document.getElementById(a); //outputs something like document.getElementById("drawer-button-1") | |||
if (z.style.display === "block") { | if (z.style.display === "block") { | ||
z.style.display = "none"; | z.style.display = "none"; | ||
b.innerHTML = "Expand"; | |||
} else { | } else { | ||
z.style.display = "block"; | z.style.display = "block"; |