I'm trying to make a program that basically shows the coordinates of a point when someone mouses over it and then makes it disappear when the mouse pointer is off the element. I have tried to do this with alert boxes but there doesn't seem to be a simple way to close them. I've looked around and people have said something about using DIVS but I have no idea where to start. This is for a introductory programming course so PLEASE no Jquery, only pure JavaScript.
for (i = 0; i < x.length; i++) {
document.getElementById("point" + i).style.left = x[i] + "px";
}
var html;
html = "";
for (i = 0; i < x.length; i++)
{
document.getElementById("point" + i).onmouseover = onmouseover;
}
}
};
function onmouseover() {
var x;
x = window.alert("X: " + this.style.left + " ," + "Y: " + this.style.top);
this.onmouseover = function () { setHTML(element, x) };
}