You mean you want the target of the onmouseover
event, so you can access the element's properties:
<script>
document.onmouseover = function(e) {
console.log(e.target.id);
}
</script>
Take a look at Event Properties for a cross-browser way to get the target (the following example is from the aforementioned website):
function doSomething(e) {
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
}
So to put those together:
document.onmouseover = function(e) {
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
console.log(targ.id);
}