title: How does one make createElement('IMG') clickable?
body: <p>My goal is to make the bottom Queen, a created element, clickable the same as the top Queen. How does one accomplish that?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;p&gt;&lt;button onclick='createAnImg()'&gt;Create Card&lt;/button&gt;&lt;/p&gt;
  &lt;img src='Card Deck/QueenHearts.png' onclick='alert("You picked the Queen of Hearts!")'&gt;
  &lt;p id='card_holder'&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function createAnImg() {
  x = document.createElement('IMG');
  x.setAttribute('id', 'Queen_of_Hearts');
  x.setAttribute('src', 'Card Deck/QueenHearts.png');
  x.setAttribute('width', '72');
  x.setAttribute('alt', 'Card Face');
  document.getElementById('card_holder').appendChild(x);
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>