Hi everyone! Help me please with my code) | SoloLearn: Learn to code for FREE!

+9

Hi everyone! Help me please with my code)

When I click in 0 why it doesn't return me alert! https://code.sololearn.com/WA14A10A151A Thank you!

5/14/2021 8:46:33 AM

Sofi (DM❌)

21 Answers

New Answer

+7

JaScript https://code.sololearn.com/W7Ello87Jb00/?ref=app

+6

JaScript Thank you soooo much for helping☺☺☺😁

+5

JaScript ok I'll try😁 thank you

+5

DerickXIGamer ok tnx

+4

For every rect one button?

+4

JaScript you mean addEventListeners?

+4

JaScript can you say me how pls?

+4

I must write it before matrix?

+4

Runtime Terror why !matrix?

+4

Oh ok😊

+4

Runtime Terror thank you☺

+4

Sofi (DM Closed❌) when you click in first row (0) it will return you alert and different for each field. This user interface is also a responsive solution. You can see it when you rotate a mobile device. https://code.sololearn.com/Wa4qv4z9Q0K0/?ref=app

+3

+2

You need to implement a listener for your array items.

+2

You could use the jQuery. https://code.jquery.com/jquery-3.6.0.js

+2

ODLNT tnx☺

+1

i think u need create a button on html or something like that :)

+1

An alternative solution using p5.js mouseClicked() event. https://code.sololearn.com/W9A5a4a21A25

0

If there's an event listener binded to the canvas then const dx = e.clientX / side; const dy = e.clientY / side; if(!matrix[~~dy] [~~dx]) alert("zero");

0

if matrix[0][0] = 0; The expression would be evaluated as a boolean if(!0) i.e if(not true)