javascript - Cannot figure out why button is not showing -
i have button submit answers go on next question on quiz app. when try put in div quiz @ button disappears. doing wrong? appreciated.
here code:
var quizapp = quiz(questions, $('#quiz-area')); quizapp.questiondisplay(); // currentquestion = 0, valid question $('#next').on('click', quizapp.nextquestion); $('#totalquestions').text(questions.length); // todo: add event listener reset $('#reset').on('click', quizapp.reset);
#quiz-area{ margin: 150px 160px; padding: 100px 40px 40px 40px; width: 500px; height: 400px; background-image: url("http://hardwoodhustle.com/wp-content/uploads/2014/03/hwh-bg1.jpg"); background-repeat: no-repeat; -webkit-background-size: cover; -mox-background-size: cover; -o-background-size: cover; background-size: cover; } div #quiz-area{ border: red 1px solid; } #quiz-area ul { border: 1px solid red; } #quiz-area li, #quiz-area ul { list-style-type: none; padding-left: 0; }
<div id="quiz-area"> <div id="next"> <button id="next" type="submit">submit answer</button> <div id="score"><span id="correct">0</span>/<span id="totalquestions">20</span></div> </div> </div>
i able figure out. logic used creates html questions in app , wiped out button. here how fixed it:
<div id="quiz-container"> <div id="quiz-area"></div> <div id="score"> <span><button id="next" type="submit">submit answer</button></span> <span id="score-board"><span id="correct">0</span>/<span id="totalquestions">20</span></span> </div> </div>
Comments
Post a Comment