The issue is that you have a quote inside a quote... Try:
Basically it's the web browser itself thinks the string onClick="... has ended when it sees the second quote.
There are other ways of doing it that are nicer, for instance you could use a third type of quotes! The templated String ones:
Or you could add a function inside a <script> tag and call that, because inside that function you won't have the quoting issues.
© Espruino, powered by microcosm.
Report a problem