Make a javascript canvas rectangle clickable

后端 未结 4 1215
夕颜
夕颜 2021-01-16 22:06

I am creating a simple calculator. Here it is. I am almost done with the basic design but I am confused on how to make the buttons clickable? One trick could be to make a di

4条回答
  •  抹茶落季
    2021-01-16 22:46

    I would recommend using SVG if you are looking to bind to graphic elements. The canvas element does not allow binding as its graphics are not considered part of the DOM. See here for a demo of binding to SVG elements.

提交回复
热议问题