0
Any Help on why the function doesn't work
If i press the button the rect does not show https://code.sololearn.com/WXD6d6IT5BF8/?ref=app
4 Answers
+ 2
Because draw function is not global. It is local to that anonymous function you assigned to window.onload.
Put that code in a script tag in html part(remove window.onload) or Use addEventListener.
+ 8
Here you go , i fixed it âș
https://code.sololearn.com/Wu4yCDP3hvEp/?ref=app
+ 5
+ 1
Thanks for the help