Hello readers, Today in this blog you’ll learn how to Create a Quiz Application with a Timer using HTML CSS & JavaScript. Earlier I shared a blog on how to Create a Responsive Personal Portfolio Website and now it’s time to create Quiz Web App using JavaScript.
In this program [Quiz App with Timer], there are three layers or boxes, and these boxes are shown one by one on a particular button clicked. At first, on the webpage, there is shown a button labeled “Start Quiz” and when you click on that button, then the info box appears with a popup animation.
In this infobox, there are some rules for the quiz and two buttons labeled “Exit” and “Continue”. When you click on the Exit button, the info box will be hidden but when you click on the Continue button, then the Quiz Box appears.
In the Quiz Box, there is a header with a title on the left side and a timer box on the right side. This timer starts decrement from 15 to 0 sec and there is also shown a timeline indicator that is sliding from the left to right side according to the timer. If the user selects an option between 15 to 0 sec, the timer will be stopped and all available options will be disabled.
If the user selected option is correct, the selected option color, and background color change to green, and there is also shown the tick icon to inform the user that the selected answer is correct. If the user selects an option that is incorrect, the selected option color and background color changed to red and there is shown the cross icon to inform the user that the selected option is incorrect and the correct option will be automatically selected.
If the user doesn’t select an option between 15 to 0 sec, the timer will be stopped once it comes to 0 and the correct option for that question will be selected automatically. After that, there is the next button to show the next question, and there is a total of five questions on this Quiz.
In the end, the result box will appear and show the user’s score and two buttons [Replay Quiz, Quit Quiz], if the user clicks on the replay quiz button, the quiz will again start with the number 1 question, and the score of the user will be 0 but if the user clicked on the quit quiz button, the current window will be reloaded and the quiz starts from the begin.
Video Tutorial of Create a Quiz App with Timer
In the video, you have seen the actual preview of the Quiz Application with Timer and I hope you’ve understood the codes behind creating this Quiz Box layout. In this video, I’ve only written the HTML & CSS codes, and in the second part of this video, I’ve completed the JavaScript codes of this program. If you haven’t watched part 2 of this video, click here to watch it now.
You can use this Quiz and also you can add more questions to this Quiz. In the source codes, I’ve written many comments on how you can add more questions and explained each JavaScript line of this Quiz. If you’re a beginner, you may have difficulties understanding the JavaScript codes but you can easily understand the HTML & CSS codes and I’ve tried to explain all JavaScript lines with comments, hope you will understand.
To create this program (Quiz Application with Timer). First, you need to create four Files one HTML File, a CSS File, and the other two JavaScript files. After creating these files just paste the following codes in your file.
First, create an HTML file with the name index.html and paste the given codes in your HTML file. Remember, you’ve to create a file with a .html extension.
<!-- Created By CodingNepal - www.codingnepalweb.com --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Awesome Quiz App | CodingNepal</title> <!-- Linking CSS for styling the quiz app --> <link rel="stylesheet" href="style.css"> <!-- FontAwesome CDN Link for Icons --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" /> </head> <body> <!-- Start Quiz Button --> <div class="start_btn"><button>Start Quiz</button></div> <!-- Info Box (displayed when the quiz starts) --> <div class="info_box"> <div class="info-title"><span>Some Rules of this Quiz</span></div> <div class="info-list"> <div class="info">1. You will have only <span>15 seconds</span> per each question.</div> <div class="info">2. Once you select your answer, it can't be undone.</div> <div class="info">3. You can't select any option once time goes off.</div> <div class="info">4. You can't exit from the Quiz while you're playing.</div> <div class="info">5. You'll get points on the basis of your correct answers.</div> </div> <div class="buttons"> <button class="quit">Exit Quiz</button> <button class="restart">Continue</button> </div> </div> <!-- Quiz Box (main container for the quiz) --> <div class="quiz_box"> <header> <div class="title">Quiz Application</div> <div class="timer"> <div class="time_left_txt">Time Left</div> <div class="timer_sec">15</div> </div> <div class="time_line"></div> </header> <section> <div class="que_text"> <!-- Question text will be inserted here by JavaScript --> </div> <div class="option_list"> <!-- Options will be inserted here by JavaScript --> </div> </section> <!-- Footer of Quiz Box --> <footer> <div class="total_que"> <!-- Question count number will be inserted here by JavaScript --> </div> <button class="next_btn">Next</button> </footer> </div> <!-- Result Box (displayed after completing the quiz) --> <div class="result_box"> <div class="icon"> <i class="fas fa-crown"></i> </div> <div class="complete_text">You've completed the Quiz!</div> <div class="score_text"> <!-- Score result will be inserted here by JavaScript --> </div> <div class="buttons"> <button class="restart">Replay Quiz</button> <button class="quit">Quit Quiz</button> </div> </div> <!-- JavaScript file for managing questions and options --> <script src="js/questions.js"></script> <!-- JavaScript file containing all quiz logic --> <script src="js/script.js"></script> </body> </html>
Second, create a CSS file with the name style.css and paste the given codes in your CSS file. Remember, you’ve to create a file with .css extension.
/* importing google fonts */ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap'); * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { overflow-x: hidden; background: #5372F0; } .start_btn, .info_box, .quiz_box, .result_box { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); } .info_box.activeInfo, .quiz_box.activeQuiz, .result_box.activeResult { opacity: 1; z-index: 5; pointer-events: auto; transform: translate(-50%, -50%) scale(1); } .start_btn button { font-size: 25px; font-weight: 500; color: #5372F0; padding: 15px 30px; outline: none; border: none; border-radius: 5px; background: #fff; cursor: pointer; } .info_box { max-width: 500px; width: 95%; background: #fff; border-radius: 5px; transform: translate(-50%, -50%) scale(0.9); opacity: 0; pointer-events: none; transition: all 0.3s ease; } .info_box .info-title { height: 60px; width: 100%; border-bottom: 1px solid lightgrey; display: flex; align-items: center; padding: 0 30px; border-radius: 5px 5px 0 0; font-size: 20px; font-weight: 600; } .info_box .info-list { padding: 15px 30px; } .info_box .info-list .info { margin: 5px 0; font-size: 17px; } .info_box .info-list .info span { font-weight: 600; color: #5372F0; } .info_box .buttons { height: 60px; display: flex; align-items: center; justify-content: flex-end; padding: 0 30px; border-top: 1px solid lightgrey; } .info_box .buttons button { margin: 0 5px; height: 40px; width: 100px; font-size: 16px; font-weight: 500; cursor: pointer; border: none; outline: none; border-radius: 5px; border: 1px solid #5372F0; transition: all 0.3s ease; } .quiz_box { max-width: 500px; width: 95%; background: #fff; border-radius: 5px; transform: translate(-50%, -50%) scale(0.9); opacity: 0; pointer-events: none; transition: all 0.3s ease; } .quiz_box header { position: relative; z-index: 2; height: 70px; padding: 0 30px; background: #fff; border-radius: 5px 5px 0 0; display: flex; align-items: center; justify-content: space-between; box-shadow: 0px 3px 5px 1px rgba(0, 0, 0, 0.1); } .quiz_box header .title { font-size: 20px; font-weight: 600; } .quiz_box header .timer { color: #004085; background: #cce5ff; border: 1px solid #b8daff; height: 45px; padding: 0 8px; border-radius: 5px; display: flex; align-items: center; justify-content: space-between; width: 145px; } .quiz_box header .timer .time_left_txt { font-weight: 400; font-size: 17px; user-select: none; } .quiz_box header .timer .timer_sec { font-size: 18px; font-weight: 500; height: 30px; width: 45px; color: #fff; border-radius: 5px; line-height: 30px; text-align: center; background: #343a40; border: 1px solid #343a40; user-select: none; } .quiz_box header .time_line { position: absolute; bottom: 0px; left: 0px; height: 3px; background: #5372F0; } section { padding: 25px 30px 20px 30px; background: #fff; } section .que_text { font-size: 25px; font-weight: 600; } section .option_list { padding: 20px 0px; display: block; } section .option_list .option { background: aliceblue; border: 1px solid #84c5fe; border-radius: 5px; padding: 8px 15px; font-size: 17px; margin-bottom: 15px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: space-between; } section .option_list .option:last-child { margin-bottom: 0px; } section .option_list .option:hover { color: #004085; background: #cce5ff; border: 1px solid #b8daff; } section .option_list .option.correct { color: #155724; background: #d4edda; border: 1px solid #c3e6cb; } section .option_list .option.incorrect { color: #721c24; background: #f8d7da; border: 1px solid #f5c6cb; } section .option_list .option.disabled { pointer-events: none; } section .option_list .option .icon { height: 26px; width: 26px; border: 2px solid transparent; border-radius: 50%; text-align: center; font-size: 13px; pointer-events: none; transition: all 0.3s ease; line-height: 24px; } .option_list .option .icon.tick { color: #23903c; border-color: #23903c; background: #d4edda; } .option_list .option .icon.cross { color: #a42834; background: #f8d7da; border-color: #a42834; } footer { height: 60px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid lightgrey; } footer .total_que span { display: flex; user-select: none; } footer .total_que span p { font-weight: 500; padding: 0 5px; } footer .total_que span p:first-child { padding-left: 0px; } footer button { height: 40px; padding: 0 13px; font-size: 18px; font-weight: 400; cursor: pointer; border: none; outline: none; color: #fff; border-radius: 5px; background: #5372F0; border: 1px solid #5372F0; line-height: 10px; opacity: 0; pointer-events: none; transform: scale(0.95); transition: all 0.3s ease; } footer button:hover { background: #0263ca; } footer button.show { opacity: 1; pointer-events: auto; transform: scale(1); } .result_box { background: #fff; border-radius: 5px; display: flex; padding: 25px 30px; max-width: 400px; width: 95%; align-items: center; flex-direction: column; justify-content: center; transform: translate(-50%, -50%) scale(0.9); opacity: 0; pointer-events: none; transition: all 0.3s ease; } .result_box .icon { font-size: 100px; color: #5372F0; margin-bottom: 10px; } .result_box .complete_text { font-size: 20px; font-weight: 500; } .result_box .score_text span { display: flex; margin: 10px 0; font-size: 18px; font-weight: 500; } .result_box .score_text span p { padding: 0 4px; font-weight: 600; } .result_box .buttons { display: flex; margin: 20px 0; } .result_box .buttons button { margin: 0 10px; height: 45px; padding: 0 20px; font-size: 18px; font-weight: 500; cursor: pointer; border: none; outline: none; border-radius: 5px; border: 1px solid #5372F0; transition: all 0.3s ease; } .buttons button.restart { color: #fff; background: #5372F0; } .buttons button.restart:hover { background: #0263ca; } .buttons button.quit { color: #5372F0; background: #fff; } .buttons button.quit:hover { color: #fff; background: #5372F0; } /* Responsive media query code for small devices */ @media (max-width: 768px) { section { padding: 25px 15px 20px 15px; } .quiz_box header, .info_box .info-title, .info_box .buttons { padding: 0 15px; } .result_box { padding: 25px 10px; } .info_box .info-list { padding: 15px; } .start_btn button { font-size: 20px; padding: 10px 25px; } }
Last, create a JavaScript file with the name of questions.js and paste the given codes in your JavaScript file. Remember, you’ve to create a file with .js extension. In this file, we store all questions in an array.
// Questions array const questions = [ { numb: 1, question: "What does HTML stand for?", answer: "Hyper Text Markup Language", options: [ "Hyper Text Preprocessor", "Hyper Text Markup Language", "Hyper Text Multiple Language", "Hyper Tool Multi Language" ] }, { numb: 2, question: "What does CSS stand for?", answer: "Cascading Style Sheet", options: [ "Common Style Sheet", "Colorful Style Sheet", "Computer Style Sheet", "Cascading Style Sheet" ] }, { numb: 3, question: "What does PHP stand for?", answer: "Hypertext Preprocessor", options: [ "Hypertext Preprocessor", "Hypertext Programming", "Hypertext Preprogramming", "Hometext Preprocessor" ] }, { numb: 4, question: "What does SQL stand for?", answer: "Structured Query Language", options: [ "Stylish Question Language", "Stylesheet Query Language", "Statement Question Language", "Structured Query Language" ] }, { numb: 5, question: "What does XML stand for?", answer: "eXtensible Markup Language", options: [ "eXtensible Markup Language", "eXecutable Multiple Language", "eXTra Multi-Program Language", "eXamine Multiple Language" ] }, ];
Last, create a JavaScript file with the name script.js and paste the given codes in your JavaScript file. Remember, you’ve to create a file with .js extension.
// Selecting all required elements const startBtn = document.querySelector(".start_btn button"); const infoBox = document.querySelector(".info_box"); const exitBtn = infoBox.querySelector(".buttons .quit"); const continueBtn = infoBox.querySelector(".buttons .restart"); const quizBox = document.querySelector(".quiz_box"); const resultBox = document.querySelector(".result_box"); const optionList = document.querySelector(".option_list"); const timeLine = document.querySelector("header .time_line"); const timeText = document.querySelector(".timer .time_left_txt"); const timeCount = document.querySelector(".timer .timer_sec"); let timeValue = 15; let queCount = 0; let queNumb = 1; let userScore = 0; let counter; let counterLine; let widthValue = 0; const restartQuizBtn = resultBox.querySelector(".buttons .restart"); const quitQuizBtn = resultBox.querySelector(".buttons .quit"); const nextBtn = document.querySelector("footer .next_btn"); const bottomQuesCounter = document.querySelector("footer .total_que"); // Show info box when start button is clicked startBtn.onclick = () => { infoBox.classList.add("activeInfo"); } // Hide info box when exit button is clicked exitBtn.onclick = () => { infoBox.classList.remove("activeInfo"); } // Start quiz when continue button is clicked continueBtn.onclick = () => { infoBox.classList.remove("activeInfo"); quizBox.classList.add("activeQuiz"); initializeQuiz(); } // Restart quiz when restart button is clicked restartQuizBtn.onclick = () => { resultBox.classList.remove("activeResult"); quizBox.classList.add("activeQuiz"); resetQuiz(); initializeQuiz(); } // Reload page when quit button is clicked quitQuizBtn.onclick = () => { window.location.reload(); } // Show next question when next button is clicked nextBtn.onclick = () => { if (queCount < questions.length - 1) { queCount++; queNumb++; updateQuiz(); } else { clearInterval(counter); clearInterval(counterLine); showResult(); } } // Initialize the quiz with the first question and timers function initializeQuiz() { showQuestions(queCount); queCounter(queNumb); startTimer(timeValue); startTimerLine(widthValue); } // Reset quiz variables function resetQuiz() { timeValue = 15; queCount = 0; queNumb = 1; userScore = 0; widthValue = 0; } // Update the quiz with the next question and reset timers function updateQuiz() { showQuestions(queCount); queCounter(queNumb); clearInterval(counter); clearInterval(counterLine); startTimer(timeValue); startTimerLine(widthValue); timeText.textContent = "Time Left"; nextBtn.classList.remove("show"); } // Show questions and options function showQuestions(index) { const queText = document.querySelector(".que_text"); let queTag = `<span>${questions[index].numb}. ${questions[index].question}</span>`; let optionTag = questions[index].options.map(option => `<div class="option"><span>${option}</span></div>`).join(''); queText.innerHTML = queTag; optionList.innerHTML = optionTag; optionList.querySelectorAll(".option").forEach(option => { option.onclick = () => optionSelected(option); }); } // Handle option selection function optionSelected(answer) { clearInterval(counter); clearInterval(counterLine); let userAns = answer.textContent; let correctAns = questions[queCount].answer; let allOptions = optionList.children.length; if (userAns === correctAns) { userScore++; answer.classList.add("correct"); answer.insertAdjacentHTML("beforeend", tickIconTag); } else { answer.classList.add("incorrect"); answer.insertAdjacentHTML("beforeend", crossIconTag); highlightCorrectAnswer(correctAns); } disableOptions(); nextBtn.classList.add("show"); } // Highlight the correct answer function highlightCorrectAnswer(correctAns) { for (let i = 0; i < optionList.children.length; i++) { if (optionList.children[i].textContent === correctAns) { optionList.children[i].classList.add("correct"); optionList.children[i].insertAdjacentHTML("beforeend", tickIconTag); } } } // Disable all options function disableOptions() { for (let i = 0; i < optionList.children.length; i++) { optionList.children[i].classList.add("disabled"); } } // Show result box function showResult() { infoBox.classList.remove("activeInfo"); quizBox.classList.remove("activeQuiz"); resultBox.classList.add("activeResult"); const scoreText = resultBox.querySelector(".score_text"); let scoreTag = ''; if (userScore > 3) { scoreTag = `<span>and congrats! , You got <p>${userScore}</p> out of <p>${questions.length}</p></span>`; } else if (userScore > 1) { scoreTag = `<span>and nice , You got <p>${userScore}</p> out of <p>${questions.length}</p></span>`; } else { scoreTag = `<span>and sorry , You got only <p>${userScore}</p> out of <p>${questions.length}</p></span>`; } scoreText.innerHTML = scoreTag; } // Start the timer for the quiz function startTimer(time) { counter = setInterval(() => { timeCount.textContent = time > 9 ? time : `0${time}`; time--; if (time < 0) { clearInterval(counter); timeText.textContent = "Time Off"; highlightCorrectAnswer(questions[queCount].answer); disableOptions(); nextBtn.classList.add("show"); } }, 1000); } function startTimerLine(time) { const totalTime = 550; // Total time for the timer in milliseconds counterLine = setInterval(() => { time += 1; let progressPercentage = (time / totalTime) * 100; timeLine.style.width = `${progressPercentage}%`; if (time >= totalTime) { clearInterval(counterLine); } }, 29); } // Update the question counter function queCounter(index) { let totalQueCounTag = `<span><p>${index}</p> of <p>${questions.length}</p> Questions</span>`; bottomQuesCounter.innerHTML = totalQueCounTag; } // Tick and cross icons const tickIconTag = '<div class="icon tick"><i class="fas fa-check"></i></div>'; const crossIconTag = '<div class="icon cross"><i class="fas fa-times"></i></div>';
That’s all, now you’ve successfully created a Create a Quiz App with Timer using HTML CSS & JavaScript. If your code doesn’t work or you’ve faced any error/problem then please download the source code files from the given download button. It’s free and a .zip file will be downloaded then you’ve to extract it.
Greetings! I know this is kind of off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!
Hi Sir, thanks a lot for this code How Can i generate questions into MySQL
Hello sir :- Create a Quiz App with Timer using HTML CSS & JavaScript
Add HTML, CSS and JavaScript code together
Thanks for the tutorial, It’s very interesting! 🙂
Can you explain how I can integrate the Math.Random() function to have random questions pls?
Reply to the comment please. Thank you 😀
how to use this in wordpress post please explain
Hello and thank you for this!
Is there a way to make the options appear as many as they are? Like I have a true of false question I’d like to add, but it offers 4 options. True, False and 2 undisclosed. If I cut to two options, The other questions appear with only the first two. Kind of a newbie here.
Again, thanx a lot.
hello,
How to add these Three codes in blogger post
please make a video how to creat a group chat on html
please make a video for how add question from admin dashboard
Hello sir,
I am clicking but it is mentioning “whilist” and I click it but there is no action. I want to get source code but the source code is not downloading. Please help me
thank u for this brilliant work.
When you click on replay, only one question shows and that question gives a wrong answer even if you select the right one. I think you should check that. Thanks
How can I make the report downloadable?
i writ all codes correct , but screen stoped in start quiz , where is problem ? please answer me necessary
How come next question after ending first question time without clicked next button
hello sir, i am ashish thanks for this sir but aap is bgmusic kim jagah par explain kar saskte ho isse hume aur acche se samaj aa jata
Hi I need to create a 2 ways of redirecting to the end.html based on your quiz score. Users who are above score need to be redirected to success.html and users under specified points need to be redirected to fail.html Thx Bro
hello, would like you share another cool video on how to create a a quiz app that accepts a users input as questions not hardcoded questions…. like admin setting questions and the loged in members can do them
Sure, I’ll try to do it!
Thx
Bro how to hack live quizz with coding yo pani vandinu paryo tapaile
Bro how to make it responsive bro . This quiz web development is excellent but it’s not responsive bro
CodingNepal
bro help me with random questions how to make the quiz random
Please make a clone on median ui
I am trying to create this quiz with 3 levels. Is this easy to do?
How to questions input from the user …….
Hi
I want to show the questions randomly. To do this I did the showQuetions (index) function, part
(let que_tag = ”+ questions[index].numb + “. ” + questions[index].question +”;)
to this
(let que_tag = ”+ questions[index].numb + “. ” + questions[Math.floor(Math.random() * 33)].question +”;)
I changed but only the question was selected randomly and the options did not match the questions. And other question options came for question 3 and ..
Please guide me so that I can show the questions randomly. Show only 10 questions out of 30 questions. Thanks
Hi, i have question. How can i add a score per question to show in the quiz. Also can i make a login page with student number.
Thx
Sir how to create automatic leaderboard in a quiz exam?
the questions are not displaying ! plz tell me what to do?
Make sure you’ve linked questions.js js file in your html file
the questions are not displaying !
Make sure you’ve linked questions.js js file in your html file
Hi coding Nepal,
Your tutorials are invaluable and thank you so much for this generous service.
Permit me to humbly suggest that you get us an android /ios app to keep us connected to and following all your creative works.
I must not forget to say that you are simply the best!
Thank you so much.
how to make the quiz question accept more than 1 or all the answers?
GOOD
Hi,
I have a website on wordpress and was wondering if I can add this quiz app in somehow? (Obvi with my own questions)
Do you know how I could do this?
thank you!!
Thanks will use in my project.
Sure, you can use it.
How can I add this code in the Blogger post..?
Simply, copy the codes and paste it inside the post HTML or theme HTML according to your need but don’t do it if you don’t know about it because your site can break.
Can this work for a teachable quiz?
You’ve to modified codes according your requirements
I am unable to make it responsive, I really need this as I am trying to implement it into my website. Can you share a quote about how to make it responsive? Everyone needs a responsive design as it doesn’t fit the mobile version of the site.
Vivek, Thanks in advance
Awesome! A enjoy the video thank you so much Nepal
Thanks for making this awesome quiz app. it’s working superbly for me no error persist. I request everyone to download the file instead of copying the codes.
Good job thank you again
You’re most welcome 🙂
I copied your code and run in my system but it doesn’t goes well. it showing many errors. if I am selected an option next question button is visible its fine. but, after selecting next question again it’s not removed it showing even without selecting any option and also one more problem the time goes to 00 seconds its not going to next question staying in current page. please help me with these problems
Please download cod files. It’s works fine!
Sir, I am such a beginner to programming. I would like to ask whether this app design applies any oop concept?
Yes, it can applies if you know about it!
Is there any way to include more than one question in a page ?
Yes but you’ve to modified codes. If you are new to this then please don’t add or remove codes but you can do it for learning or analyzing codes
Hi CodingNepal,
is there a way to hide questions.js from being inspected/view source?
thanks,
No, it’s features of every browser to show JavaScript codes
Thank You. Loved it
You’re welcome
Hey bro, I loved the way you do but when I click on the start quiz but it doesn’t show anything. Can you help me here
Try download source files
Can both questions and answer's be randomized?
This was really very helpful for me. It just saved me in time. THANKK YOU VERYY MUCH FOR MAKING SUCH AN AMAZING WEBSITE.THANKYOU…..
thank very very much
As could be done for the timer outside the total time of all the questions and not by individual question, I want to set a maximum time to answer all the questions of 40 minutes
Glad you like it
This is a very nice quiz game. I'll use it to study the code and try to learn from it.
Thank you so much for sharing your work.
You're most welcome 🙂
Hey please email me. I'll send you the css codes with make it responsive once I'll be free
You're welcome brother
Thank you very much brother, It helped me to do the quiz for my students very well.
Hello again, I have tried many attempts, but with no sucess. I put some defaults media breakpoints, and it worked partially(only for mobile), Desktop version is stretching to 100%(component is not in the middle). You said main container, but I couldn't find. Do you mind to share the version of the CSS fully responsive? I am trying to learn some css too. Thank you so much!
I have given fixed with to main container just remove it and give width in percent and add some media breakpoints
I am unable to make it responsive, I really need this as I am trying to implement it into my website. Can you share a quote about how to make it responsive? Everyone needs a responsive design as it doesn’t fit the mobile version of the site.
Vivek, Thanks in advance
Hey bro, how to make this app become responsive? Any ideas? Thank you so much!
No once you select an option, you can't select any other again then how you get this problem?
You're welcome bro 🙂
Ok then…?
You're welcome 😉
it is working perfectly thank you so much
i created my own html , css and js files then i copied the html code above pasted in my html file and the css the the js is codes provided here i copied the questions array code and pasted in my js file then the functions code past it under the question array
thank you !
A.Moallim
Thanks Bro for share with community nice and clean contents. Keep it up! Everything is working fine!
nice it worked superb but one mistake when i click the wrong or correct option more than one time it shows the icon many times inside the flex display kindly check that and guide me for the solution. but anyway thank you
I didn't understand
how only one file no athor file quize.html no js file no css file plese
just merge every CSS and js file into the index HTML file
Yes but you have to change the codes. I'll do in my upcoming videos. Stay tuned.
I cant go beyond the start quiz button. I click it and then theres nothing.
Please, download the code files from the given download button.
I cant download the html code as it goes straight to the web view
The same thing happened to me, but I than looked at the ode and relized, that you have to put all the .js files in a folder named js.
Is there a way to replace the question text with an image?
NO
use JavaScript random method.
use media query or give width in percent.
nice work Sir,
but here all questions are fixed in sequence.
I wanted a shuffle question. Is there any logic in javascript to shuffle all questions?
How do you make the quiz responsive?
No there is no error. As I've shown in the demo part, when you clicked on the replay quiz button quiz will repeat from questions without showing info box but when you clicked on the quit quiz button then quiz will begin from start. Please download files instead of copying codes.
when i click on Replay Quiz button it shows only html quiz, then i click on next button it open result box without showing css,php,sql and xml quiz
i think there is an error in your script.js file
I've rechecked my codes there is no problems. I don't why you're facing it. Please send the screenshot of error on my Instagram account.
Yes @Codingnepal I am a Sri Lankan. But my favorite tech youtuber is you .. I don’t see any mistakes in your codes .. Congratulations you go ahead
Thank you so much and keep visiting <3
hello
i have error on pressing the botton
it wont start up or move to next
Please, download the coding files from the given download button and try again!
You have to seperate the javascript files from one another if you are copying and pasting the code. If you paste the 2 files codes’ in just the HTML file, there will be an error.
Thank you!
GREAT
nice