title: Pyscript button
body: <p>I'm confused. I'm trying to run pyscript button example from - <a href="https://jeff.glass/post/7-guis-pyscript/" rel="nofollow noreferrer">https://jeff.glass/post/7-guis-pyscript/</a> (first example - counter)</p>
  <p>This is the HTML code</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
      &lt;title&gt;Hello, World!&lt;/title&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;https://pyscript.net/alpha/pyscript.css&quot; /&gt;
      &lt;script defer src=&quot;https://pyscript.net/alpha/pyscript.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
          &lt;p id=&quot;counter-target&quot;&gt;Some Placeholder Text&lt;/p&gt;
          &lt;py-button&gt;
                  def on_click(event):
                          add_one()
          &lt;/py-button&gt;
  &lt;py-script src=&quot;myscript.py&quot;&gt;&lt;/py-script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>This is the PYTHON CODE:</p>
  <pre><code>internalCount = 0
  target = &quot;counter-target&quot;
  PyScript.write(target, str(internalCount), append=False)
  
  def add_one():
      global internalCount
      internalCount += 1
      PyScript.write(target, str(internalCount), append=False)
  </code></pre>
  <p>It's showing me the button (using VSC Live server), but nothing happens once clicking on it... also Visual studio code is showing me this error. I don't understand. I shouldn't import anything, right? Thanks</p>
  <p><a href="https://i.stack.imgur.com/yWWbZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yWWbZ.png" alt="pyscript error" /></a></p>