const buttons = { d: { up: () => document.getElementById("dUp"), down: () => document.getElementById("dDown"), right: () => document.getElementById("dRight"), left: () => document.getElementById("dLeft"), }, ab: { a: () => document.getElementById("a"), b: () => document.getElementById("b"), }, aux: { start: () => document.getElementById("start"), select: () => document.getElementById("select"), }, }; console.log(buttons.ab.a); buttons.ab.a.style.backgroundColor = "pink";