Why doesn't this work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why doesn't this work?

I'm trying to get the x and y of a click only if the click happened inside canvas2 or c2 but it doesnt work, why? This code is just a test that's why it's nothing much. https://code.sololearn.com/WoF053LzVR81/?ref=app

8th Dec 2019, 6:00 AM
Lemonades For Sale
Lemonades For Sale - avatar
4 Answers
+ 2
Try function drawE(){ ctx2.fillStyle = 'grey'; ctx2.fillRect(50, 50, 200, 200); ctx2.fillStyle = 'black'; ctx2.fillRect(100, 100, 100, 100); }
8th Dec 2019, 6:19 AM
Calviղ
Calviղ - avatar
0
You tryed run this code in browser or different place?
8th Dec 2019, 6:10 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Browser
8th Dec 2019, 6:15 AM
Lemonades For Sale
Lemonades For Sale - avatar
0
Damn I'm so dumb. Thanks tho
8th Dec 2019, 6:22 AM
Lemonades For Sale
Lemonades For Sale - avatar