<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
let menu = document.querySelector("ul");
let menuItems = menu.querySelectorAll("li");
for (let item of menuItems) {
item.addEventListener("click", myfunction);
}
const siblings = Array.prototype.filter.call(
this.parentNode.children,
n => n !== this
);
const siblings = [];
for (let el = this; (el = el.previousElementSibling); siblings.unshift(el)) ;
for (let el = this; (el = el.nextElementSibling); siblings.push(el)) ;