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
5 ответов
+ 2
Try
function drawE(){
ctx2.fillStyle = 'grey';
ctx2.fillRect(50, 50, 200, 200);
ctx2.fillStyle = 'black';
ctx2.fillRect(100, 100, 100, 100);
}
0
You tryed run this code in browser or different place?
0
Browser
0
Damn I'm so dumb. Thanks tho