title: Javascript addEventListener not reading resize
body: <p>Hi I'm trying to add an eventListener where it adds an h1 tag with the width and height of the browser when your resize it. I don't understand why it's not working.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;Window size&lt;/title&gt;
  
  
  &lt;/head&gt;
  
  
  &lt;body&gt;
  
  &lt;div id="wh"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  "use strict";
  
  document.addEventListener("onresize", function(){
  
   var width = document.documentElement.clientWidth;
   var height = document.documentElement.clientHeight;
  
   document.getElementById('wh').innerHTML = "&lt;h1&gt;Width: " + width + "  Height: " + height + "&lt;/h1&gt;";
  
  });
  
  
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>