Svg clicker? | Sololearn: Learn to code for FREE!

+2

Svg clicker?

Is it possible to use svg and turn it into something you can click? For example, if I were to make a circle in svg, is it possible to use that circle as something you click in a clicker game?

10/28/2019 8:46:43 AM

RazzleDazzle

3 Answers

New Answer

+4

Like any other html elements, just add attribute onclick with the calling function. https://code.sololearn.com/W1RHAYwjvH0S/?ref=app

+5

Calviղ The button has a reception range that lies outside the actual button. Perhaps you could place the on click onto the <circle> rather than the <svg>?

+1

Calviղ Thank you!