The canvas element is primarily used to draw images and graphics to your web page and behaves as a relatively inactive component on your web page. This is fine for many uses, such as in a graphing application where it is used for output. It's also okay for applications that rely on keyboard input, such as online games, as you can attach your keyboard event handlers to the web page and let those change the view on the canvas. But what if you want to build an application using the canvas element, which includes components that are interactive, eg clickable?
展开▼