This is what I have so far:
for(var i;i< 99999;i++){
if(mouse.x == element.x,mouse.y == element.y){
element.click
This is what I have so far:
for(var i;i< 99999;i++){
if(mouse.x == element.x,mouse.y == element.y){
element.click
use window.mouseover
to listen the mouse event
var item;
window.addEventListener("mouseover", function( event ) {
// the mouseover target
item = event.target;
}, false);
// now you can use the item
window.addEventListener("click", spawn);
function spawn(e){
console.log(e.clientX);
console.log(e.clientY);
}
click anywhere in the window...