title: Add CSS class to HTML with Javascript ternary operator
body: <p>I need to add a checkmark image from the css class <code>.checkmark</code> or <code>.stem</code> but don´t know how to add it.<br/>
  I have tried different solutions but I only get errors or just a <code>string</code>. The image checkmark should be added to the ternary operator where it says <code>checkmark</code>.</p>
  <pre><code>import {
      myArray
  } from './theData.js';
  
  function addCheckmark() {
      let checkmark = document.getElementsByClassName(&quot;.checkmark&quot;);
      let stem = document.getElementsByClassName(&quot;.stem&quot;);
      checkmark.appendChild(stem)
  }
  
  buildTable(myArray);
  
  function buildTable(data) {
      for (var i = 0; i &lt; data.length; i++) {
          let row = `&lt;tr&gt;
      &lt;td&gt;${data[i].gameNumber}&lt;/td&gt;
      &lt;td&gt;${data[i].teams[&quot;1&quot;].name} -VS- ${data[i].teams[&quot;2&quot;].name}&lt;/td&gt;
      &lt;td&gt;${data[i].outcome === &quot;1&quot; ? &quot;checkmark&quot;:  &quot;&quot;}&lt;/td&gt;
      &lt;td&gt;${data[i].outcome === &quot;X&quot; ? &quot;checkmark&quot; : &quot;&quot;}&lt;/td&gt;
      &lt;td&gt;${data[i].outcome === &quot;2&quot; ? &quot;checkmark&quot; : &quot;&quot;}&lt;/td&gt;
  
      &lt;/tr&gt;`
          table.innerHTML += row;
      }
  }
  </code></pre>