title: Python Transcrypt addEventListener
body: <p>I have written a Python program for translation with Transcrypt to Javascript.
  I can not get the addEventListener function to work. Any ideas?</p>
  
  <p>Here is the code as dom7.py:</p>
  
  <pre><code>class TestSystem:
  
  def __init__ (self):
      self.text = 'Hello, DOM!'
      self.para = 'A new paragraph'
      self.textblock = 'This is an expandable text block.'
      self.button1 = document.getElementById("button1")
      self.button1.addEventListener('mousedown', self.pressed)
  
  def insert(self):,
      document.querySelector('output').innerText = self.text
      # document.querySelector('test').innerText = "Test"+self.button1+":"
  
  def pressed(self):
      container = document.getElementById('textblock')
      newElm = document.createElement('p')
      newElm.innerText = self.para
      container.appendChild(newElm)
  
  testSystem = TestSystem()
  </code></pre>
  
  <p>And here follows the corresponding dom7.html for it:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;script src="__javascript__/dom7.js"&gt;&lt;/script&gt;
  &lt;title&gt;Titel&lt;/title&gt;
  &lt;/head&gt;
  &lt;body onload=dom7.testSystem.insert()&gt;
  &lt;button id="button1"&gt;Click me&lt;/button&gt;&lt;br&gt;
  &lt;main&gt;
      &lt;h1&gt;DOM examples&lt;/h1&gt;
      &lt;p&gt;Testing DOM&lt;/p&gt;
      &lt;p&gt;
          &lt;output&gt;&lt;/output&gt;
      &lt;/p&gt;
    &lt;p&gt;
      &lt;test&gt;Test String:&lt;/test&gt;
    &lt;/p&gt;
  
    &lt;div id="textblock"&gt;
      &lt;p&gt;This is an expandable text block.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/main&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>