function toggle(el) { el.style.display = (el.style.display == 'none') ? '' : 'none' var elt = document.querySelector('.arrow') elt.style.transform = elt.style.transform == "rotate(180deg)"?"rotate(0deg)":"rotate(180deg)"; }