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'); });

9th Dec 2019, 12:42 AM
Lemonades For Sale
Lemonades For Sale - avatar
2 ответов
0
Why += Why not just + Like "headX + headW"
9th Dec 2019, 8:37 PM
Mystic Life
Mystic Life - avatar
0
Yea I figured it out a little while ago but thanks
9th Dec 2019, 11:12 PM
Lemonades For Sale
Lemonades For Sale - avatar
Актуальное сегодня
.
1 Votes
What?
0 Votes
HTML
0 Votes
FRC Coding?
1 Votes
Quiz duel
0 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes
Create Agent
0 Votes