title: Where to insert image links in javascript code?
body: <p>I am having trouble adding images links to the questions. I'm not going to use the questions in the code. There will be 20 questions that are &quot;What Star Wars Character is this?&quot; so the user will have to guess the character based on the image. Where exactly would I put the image link and what other code will I have to add? Thank you very much!</p>
  <pre><code>var questionCounter = 0;
  
  var quiz = [
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Emperor Palpatine&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Emperor Palpatine&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Yoda&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Yoda&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Han Solo&quot;, &quot;Commander Cody&quot;, &quot;R2-D2&quot;, &quot;Boba Fett&quot;],
    &quot;correct&quot;: &quot;Han Solo&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Darth Maul&quot;, &quot;General Grievous&quot;, &quot;Count Dooku&quot;, &quot;Darth Vader&quot;],
    &quot;correct&quot;: &quot;Darth Maul&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Obi-Wan Kenobi&quot;, &quot;Princess Leia&quot;, &quot;Chewbacca&quot;, &quot;Jar Jar Binks&quot;],
    &quot;correct&quot;: &quot;Obi-Wan Kenobi&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;General Grievous&quot;, &quot;Plo Koon&quot;, &quot;Nute Gunray&quot;, &quot;Darth Plagueis&quot;],
    &quot;correct&quot;: &quot;General Grievous&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Darth Vader&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Darth Vader&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Darth Plagueis&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Darth Plagueis&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Count Dooku&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Count Dooku&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;C-3PO&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;C-3PO&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;R2-D2&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;R2-D2&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Commander Cody&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Commander Cody&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Boba Fett&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Boba Fett&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Luke Skywalker&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Luke Skywalker&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Princess Leia&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Princess Leia&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Chewbacca&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Chewbacca&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Jar Jar Binks&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Jar Jar Binks&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Kit Fisto&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Kit Fisto&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Plo Koon&quot;, &quot;General Grievous&quot;, &quot;Darth Maul&quot;, &quot;Count Dooku&quot;],
    &quot;correct&quot;: &quot;Internet&quot;
  }, 
  {
    &quot;question&quot;: &quot;What Star Wars character is this?&quot;,
    &quot;choices&quot;: [&quot;Nute Gunray&quot;, &quot;Yoda&quot;, &quot;Darth Vader&quot;, &quot;Han Solo&quot;],
    &quot;correct&quot;: &quot;Nute Gunray&quot;
  }
  ];
  
  var currentQuestion = Math.floor(Math.random() * quiz.length);
  
  quiz.forEach(q =&gt; q.choices.sort(() =&gt; Math.random() - .5));
  
  
  var content = $(&quot;content&quot;),
    questionContainer = $(&quot;question&quot;),
    choicesContainer = $(&quot;choices&quot;),
    scoreContainer = $(&quot;score&quot;),
    submitBtn = $(&quot;submit&quot;);
  
  
    score = 0,
    askingQuestion = true;
  
  function $(id) {   return document.getElementById(id);
  }
  
  function askQuestion() {
  
      questionCounter++;
  
    var choices = quiz[currentQuestion].choices,
      choicesHtml = &quot;&quot;;
  
    for (var i = 0; i &lt; choices.length; i++) {
      choicesHtml += &quot;&lt;input type='radio' name='quiz&quot; + currentQuestion +
        &quot;' id='choice&quot; + (i + 1) +
        &quot;' value='&quot; + choices[i] + &quot;'&gt;&quot; +
        &quot; &lt;label for='choice&quot; + (i + 1) + &quot;'&gt;&quot; + choices[i] + &quot;&lt;/label&gt;&lt;br&gt;&quot;;
    }
  
    questionContainer.textContent = &quot;Q&quot; + (questionCounter) + &quot;. &quot; +
      quiz[currentQuestion].question;
  
    choicesContainer.innerHTML = choicesHtml;
  
    if (questionCounter === 1) {
      scoreContainer.textContent = &quot;Score: 0 right answers out of &quot; +
        quiz.length + &quot; possible.&quot;;
      submitBtn.textContent = &quot;Submit Answer&quot;;
  
  
    }
  
  }
  
  function checkAnswer() {
  
    if (askingQuestion) {
      submitBtn.textContent = &quot;Next Question&quot;;
      askingQuestion = false;
  
      var userpick,
        correctIndex,
        radios = document.getElementsByName(&quot;quiz&quot; + currentQuestion);
      for (var i = 0; i &lt; radios.length; i++) {
        if (radios[i].checked) { 
          userpick = radios[i].value;
        }
  
        if (radios[i].value == quiz[currentQuestion].correct) {
          correctIndex = i;
        }
      }
  
      var labelStyle = document.getElementsByTagName(&quot;label&quot;)[correctIndex].style;
      labelStyle.fontWeight = &quot;bold&quot;;
      if (userpick == quiz[currentQuestion].correct) {
        score++;
        labelStyle.color = &quot;green&quot;;
      } else {
        labelStyle.color = &quot;red&quot;;
      }
      
      scoreContainer.textContent = &quot;Score: &quot; + score + &quot; right answers out of &quot; +
        quiz.length + &quot; possible.&quot;;
    } else {
      askingQuestion = true;
      submitBtn.textContent = &quot;Submit Answer&quot;;
      if (currentQuestion &lt; quiz.length - 1) {
        currentQuestion++;
        askQuestion();
      } else {
        showFinalResults();
      }
    }
  }
  
  function showFinalResults() {
    content.innerHTML = &quot;&lt;h2&gt;Quiz Completed.&lt;/h2&gt;&quot; +
      &quot;&lt;h2&gt;Below are your results:&lt;/h2&gt;&quot; +
      &quot;&lt;h2&gt;&quot; + score + &quot; out of &quot; + quiz.length + &quot; questions, &quot; +
      Math.round(score / quiz.length * 100) + &quot;%&lt;h2&gt;&quot;;
  }
  
  window.addEventListener(&quot;load&quot;, askQuestion, false);
  submitBtn.addEventListener(&quot;click&quot;, checkAnswer, false);
  </code></pre>