So I'm making an idle game and I want a description to pop up at the bottom whenever you hover over a button. I've given each button an id and a class, the class is to detect when mouse over any button and the id to set the data for the description. FYI I'm using Jquery as well.
Here's the code:
HTML:
<button id="pick" class="shopButton">Pick a carrot</button>
<button id="refine" class="shopButton"Refine carrots</button>
JS:
$(".shopButton").mouseenter(function showDescription() {
document.getElementById('description').style.display = "block";
document.getElementById('descriptionHeader').innerHTML =
document.getElementById('descriptionText').innerHTML =
});
const pick = {
header = "Header";
text = "Text";
}
How should I do this?
I haven't tried anything yet because idk what would work (I'm fairly new to js)