function onClick() {
const color = `#${(Math.random() * 0xFFFFFF | 0).toString(16).padStart(6, 0)}`;
document.querySelectorAll(`.${this.id}`).forEach(n => {
n.style.backgroundColor = color;
});
}
document.querySelectorAll('li').forEach(n => n.addEventListener('click', onClick));