title: Why addEventListener doesn't work in jsdom module for nodejs
body: <p>I use the following code to call some stuff after clicking by an element on a page</p>
  
  <pre><code>var http = require('http');
  var fs = require('fs');
  var jsdom = require('jsdom');
  
  http.createServer(function(req, res) {
  
      res.writeHead(200, {'Content-Type': 'text/html; charset=utf8'});
      var document = new jsdom.JSDOM('&lt;!doctype html&gt;&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Text&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;').window.document;
      document.getElementsByTagName('p')[0].addEventListener('click', function() {
          alert('OK');
      });     
      var page = '&lt;!doctype html&gt;&lt;html&gt;'+document.getElementsByTagName('html')[0].innerHTML+'&lt;/html&gt;';
      res.end(page);
  
  }).listen(80, 'localhost');
  </code></pre>
  
  <p>But if I click the paragraph, nothing happens</p>
  
  <p>I read the answer by the link <a href="https://stackoverflow.com/a/36804251/10587062">https://stackoverflow.com/a/36804251/10587062</a> but I didn't understand how to resolve my problem</p>