Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const questions = [
- {
- question: "What is 2 + 2?",
- answes: [3,4,5,6]
- },
- {
- question: "What is 6 + 2?",
- answes: [9,8,5,6]
- },
- {
- question: "What is 10 + 30?",
- answes: [32,45,40,34]
- }
- ]
- const p = document.getElementById("qtn");
- document.getElementById("next").addEventListener("click",()=> {
- for (let i=0; i<questions.length;i++){
- p.textContent = questions[i].question;
- }
- });
- const i=0;
- const p = document.getElementById("qtn");
- document.getElementById("next").addEventListener("click",()=> {
- p.textContent = questions[i].question;
- i++
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement