Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.96 KB

read.md

File metadata and controls

32 lines (24 loc) · 1.96 KB

// TODO 1: Declare & assign variables pointing to the corresponding element(s) // statement should be the "statement" div // optionButtons should be all the elements within the "options" div // explanation should be the "explanation" div

// TODO 2: Declare & assign a variable called fact
// Its value should be an object with a statement, true/false answer, and explanation

// TODO 3: Set the text of the statement element to the fact's statement

// TODO 4: Declare disable & enable functions to set or remove the "disabled" attribute from a given button element
// disable(button) should set the button element's attribute "disabled" to the value ""
// enable(button) should remove the attribute "disabled" from the button element

// TODO 5: Declare an isCorrect function that compares a guess to the right answer
// isCorrect(guess) should return true if the guess matches the fact's answer

// TODO 6A: Use a for loop to add a click event listener to each of the optionButtons
// TODO 6B: Within the event handler function, display the fact's explanation by setting the text of the explanation element

// TODO 7: Within the event handler function,
// Use a for loop to disable all the option buttons

// TODO 8: Within the event handler function,
// Get the guessed value from the clicked button
// Use a conditional to compare the guess to the fact's answer
// and add the "correct"/"incorrect" class as appropriate

//Style the appliction //I continue the js quizz that I did during the Anjana Vakil's cours (i thought it was faster to work on a app that I already did/ but I can start over with https://javascriptissexy.com/how-to-learn-javascript-properly/ ) //I checked the https://themeforest.net/ and I choose the style of this application: https://templates.seekviral.com/quiza/quiz/Quiz6/index.html and https://templates.seekviral.com/qzain/quiz/Quiz12/index.html I made a deploy https://quiz-js-roxana-teodora.netlify.app/