Svg clicker? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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?

28th Oct 2019, 8:46 AM
RazzleDazzle
3 Respostas
+ 4
Like any other html elements, just add attribute onclick with the calling function. https://code.sololearn.com/W1RHAYwjvH0S/?ref=app
28th Oct 2019, 9:09 AM
CalviÕ²
CalviÕ² - avatar
+ 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>?
28th Oct 2019, 9:56 AM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
+ 1
CalviÕ² Thank you!
28th Oct 2019, 9:22 AM
RazzleDazzle