New course! Every coder should learn Generative AI!
Try a free lesson0
Can anyone help me with this code?
https://code.sololearn.com/WTGdR88j8lNZ/?ref=app I don't know why there is ERROR in my code
2 Answers
+ 4
Read the error message carefully: You did not define any variable or constant with the name "Context". Hence it is unclear what "Context" refers to.
0
zain Shendy
You may work with canvas, first of all you need to create a <canvas> with a specific width and height and id, then select the canvas with its I'd and save to your Context variable.
Remember onclick event is not work as write it, the event should capture throw an event listener call back function.