<p id="ikut">I am always ikut</p>
<script>
document.onmousemove = function(e){
var b = "X: "+e.pageX+"<br/>Y: "+e.pageY;
var a = document.getElementById('ikut');
a.setAttribute('style','position: absolute; top: '
+(e.pageY)+'; left: '+e.pageX+';');
a.innerHTML = b;
};
</script>
<style>
#ikut { font: 12px arial; background: azure; width: 50px; display: inline; border: 1px solid #aaa; border-radius: 4px; padding: 5px;}
</style>
No comments:
Post a Comment