div=document.getElementsByTagName('div')[0];
btShow=document.getElementsByTagName('button')[0];
btHide=document.getElementsByTagName('button')[1];
btShow.onclick=function(){
document.body.onmousemove=function(event){
var e=event||window.event;
div.style.left=e.clientX+"px";
div.style.top=e.clientY+"px";
}
div.style.display="block";
}
btHide.onclick=function(){
document.body.onmousemove=function(){};
div.style.display="none";
}
Works for me on FF17ESR, OS/2, should work on IE and WebKit as well. If you want the block to disappear onmouseout and appear onmouseover, rather than on buttons' clicks, then just define the proper event handlers.