title: json/js/html quiz: how can I parse json data into a for loop and if statements?
body: <p>I have a json file: </p>
  
  <pre><code>{
    "questions": [
      {
        "title": "01. q1",
        "type": "dropdown",
        "options": [
          {
            "1",
            "2",
            "3"
          }
        ]
      },
      {
        "title": "q2",
        "type": "multiple_choice",
        "options": [
          "1",
          "2",
          "3",
          "4",
          "5"
        ]
      },
  </code></pre>
  
  <p>And I'm trying to write a for loop in a js file in order to go through the data, and if the question type is "dropdown", display an html dropdown selectors, "multiple choice" would get buttons, etc: </p>
  
  <pre><code>console.log = function(message) {
      document.getElementById('q_1').innerHTML = message;
  };
  
  console.log2 = function(message) {
      document.getElementById('q_2').innerHTML = message;
  };
  
  $.getJSON("generated.json", function(json)) {
    for (var i = 0; i&lt;json.questions.length; i++) {
      if(json.questions[i].type=="drop_down") {
  
      }
    }
  }
  </code></pre>
  
  <p>I'm really confused as to how to do this dynamically and not hard code most of the code. Is there a way for this to be written concisely without having to write out every option/question in an html file and just read and generate questions from the json file?</p>