for example, we'll create a simple webpage that has a red canvas, whenever we click 'B' on our keyboard, it changes to blue, and 'R' for red. (go to the below repl)
Cool! we just created our red canvas!
first, we need to add an event listener to our webpage -
that was very loooooong, now coming to the if statement, here is the code -
Upvote if you find this tutorial helpful :)