title: Adding images to an HTML document with JavaScript
body: <p>I've tried some HTML DOM code from several sites, but it isn't working. It isn't adding anything. Does anyone have a working example on this?</p>
  <pre><code>this.img = document.createElement(&quot;img&quot;);
  this.img.src = &quot;img/eqp/&quot;+this.apparel+&quot;/&quot;+this.facing+&quot;_idle.png&quot;;
  src = getElementById(&quot;gamediv&quot;);
  src.appendChild(this.img)
  </code></pre>
  <p>But it isn't adding anything to the div <code>gamediv</code>. I've tried <code>document.body</code> as well, with no result.</p>
  <p>Thanks in advance.</p>