<div id="text">тут</div>
<button id="1" class="button">1</button>
<button id="2" class="button">2</button>
<button id="3" class="button">3</button>
<button id="4" class="button">4</button>
const data = {
1:'текст 1',
2:'текст 2',
3:'текст 3',
4:'текст 4'
}
const buttons = [...document.querySelectorAll('.button')]
buttons.map(item => {
item .addEventListener("click", function() {
document.getElementById("text").innerHTML =
data[this.id]
});
})