all reset
☀ Lights
Netbax Online Editor Try it Yourself
Run
HTML
reset
copy
Menu
Pages#1
Pages#2
Menu#1
Pages#1
Pages#2
Menu#2
Pages#1
Pages#2
Pages#3
Pages#4
CSS
reset
copy
ul, #net { list-style-type: none; } #net { margin: 0; padding: 0; } .net1 { cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; font-family: Tahoma; font-size: 20px; text-transform: capitalize; color:#000; } .net1::before { content: "\25B6"; color: #c00; display: inline-block; margin-right: 6px; } .net1-down::before { -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); } .net2 { display: none; font-family: Tahoma; font-size: 20px; text-transform: capitalize; color:#555; } .net3 { display: block; }
Js
JAVASCRIPT
reset
copy
var toggler = document.getElementsByClassName("net1"); var i; for (i = 0; i < toggler.length; i++) { toggler[i].addEventListener("click", function() { this.parentElement.querySelector(".net2").classList.toggle("net3"); this.classList.toggle("net1-down"); }); }