Okay so basically I'm using a button type in HTML, I have two buttons with different id's as an example:
<button id='Sucky27' class="btn27"></button>
<button id='Sucky28' class="btn28"></button>
the buttons call a javascript function as follows:
document.getElementById("Sucky28").addEventListener("click", function() {
document.querySelector(".BuildingMenu").style.display = "flex";
})
when the button is pressed it opens a building menu then when you click on an item in the menu ie a house this gets runned
document.getElementById("House").addEventListener("click", function() {
document.querySelector("function.caller.id").style.backgroundImage = "url(./download.PNG)";
})
I'm wondering if there's a way for the querySelector to find the id of the caller which initiated the building menu so if id sucky27 opens the menu it uses its id and changes the its properties
I hope I explained it well enough for you to understand