Trying to get an alert to appear on mouseover, using Javascript, for a div element. I can get the div element to print in the console, but nothing else happens.
The div has some text in it, I tried changing it to activate on the text instead of the div but I still couldn’t get it to work.
window.onload = pageReady;
function pageReady(){
var buttonBox = document.getElementById("buttonBox");
console.log(buttonBox);
function askUser(){
alert("It worked!");}
buttonBox.onmouseover = askUser;
}