script.js
// In the dislayQuestion () I made the h1 the question.  So that the questions wouldn't show up on the page over and over, I cleared the wrapper's contents using the innerHTML property with empty quotes.  The question element was appended to the parent wrapper element. I made a div for the choices element, so that I could append the buttonEl div to it. I made a for loop to loop through the questions and choices.
In the dislayQuestion () I made the h1 the question.  So that the questions wouldn't show up on the page over and over, I cleared the wrapper's contents using the innerHTML property with empty quotes.  The question element was appended to the parent wrapper element. I made a div for the choices element, so that I could append the buttonEl div to it. I made a for loop to loop through the questions and choices.
In the dislayQuestion () I made the h1 the question . So that the questions wouldn ' t show up on the page over and over I cleared the wrapper ' s contents using the innerHTML property with empty quotes . The question element was appended to the parent wrapper element . I made a div for the choices element so that I could append the buttonEl div to it . I made a for loop to loop through the questions and choices .
function displayQuestion() {
    var question = document.createElement("h1");
    question.textContent = myQuestions[currentQuestion].question;
    wrapper.innerHTML = ""; 
    wrapper.appendChild(question);
    var choicesEl = document.createElement("div");
    for (var i = 0; i < myQuestions[currentQuestion].choices.length; i++) {
        console.log(myQuestions[currentQuestion].choices[i])
        var buttonEl = document.createElement("button");
        buttonEl.setAttribute('class', 'choice');
        buttonEl.setAttribute('which', i);
        buttonEl.onclick = clickedButton;
        buttonEl.textContent = myQuestions[currentQuestion].choices[i];
        choicesEl.appendChild(buttonEl);
    }
    wrapper.appendChild(choicesEl);
}
function displayQuestion ( ) { var question = document . createElement ( "h1" ) ; question . textContent = myQuestions [ currentQuestion ] . question ; wrapper . innerHTML = "" ; wrapper . appendChild ( question ) ; var choicesEl = document . createElement ( "div" ) ; for ( var i = 0 ; i < myQuestions [ currentQuestion ] . choices . length ; i ++ ) { console . log ( myQuestions [ currentQuestion ] . choices [ i ] ) var buttonEl = document . createElement ( "button" ) ; buttonEl . setAttribute ( 'class' , 'choice' ) ; buttonEl . setAttribute ( 'which' , i ) ; buttonEl . onclick = clickedButton ; buttonEl . textContent = myQuestions [ currentQuestion ] . choices [ i ] ; choicesEl . appendChild ( buttonEl ) ; } wrapper . appendChild ( choicesEl ) ; }
In the dislayQuestion () I made the h1 the question.
In the dislayQuestion () I made the h1 the question .
// clear everything in wrapper