JavaScript innerHTML is undefined
<p>Struggling with why .innerHTML shows undefined, yet .length shows 1. </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-js lang-js prettyprint-override"><code>var content = document.getElementsByTagName("h1");
console.log(content.innerHTML);
console.log(content.length);</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h1&gt;Hello World&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;This is an item&lt;/li&gt;
  &lt;li&gt;This is another item&lt;/li&gt;
&lt;/ul&gt;</code></pre>
</div>
</div>
</p>