0
Why doesnt this work?
I'm trying to make it give an alert if you clicked within the given x and y but it desn't work, why? c.addEventListener('click', function(evt){ if( evt.X > headX && evt.X < headX += headW && evt.Y > headY && evt.Y < headY += headH ) alert('You clicked it'); });
2 Answers
0
Why +=
Why not just +
Like "headX + headW"
0
Yea I figured it out a little while ago but thanks