html-quiz

Step into the world of HTML and test your knowledge of the foundational language that structures the web. This quiz will challenge your understanding of HTML elements, attributes, and best practices, helping you solidify your skills. Ready to prove your expertise? Let’s get started!
We recommend that you do not leave the page that you are taking this quiz in. Stay honest 🙂
HTML Quiz
0% Complete
1 of 10
1. What does HTML stand for?
Basic definition of HTML

HTML Quiz Questions Overview

1. What does HTML stand for?

Hyper Text Markup Language
Home Tool Markup Language
Hyperlinks and Text Markup Language
Hyperlinking Text Marking Language

2. Which HTML element is used to define the title of a document?

</div><div class="question-answer"><head></div><div class="question-answer"><meta></div><div class="question-answer"><body></div></div><div class="question-container"><h3 class="question-subject">3. What is the correct HTML element for inserting a line break?</h3><div class="question-answer"><br></div><div class="question-answer"><break></div><div class="question-answer"><lb></div><div class="question-answer"><line></div></div><div class="question-container"><h3 class="question-subject">4. Which HTML attribute is used to define inline styles?</h3><div class="question-answer">style</div><div class="question-answer">class</div><div class="question-answer">id</div><div class="question-answer">font</div></div><div class="question-container"><h3 class="question-subject">5. What is the correct HTML element for the largest heading?</h3><div class="question-answer"><h1></div><div class="question-answer"><heading></div><div class="question-answer"><h6></div><div class="question-answer"><head></div></div><div class="question-container"><h3 class="question-subject">6. Which HTML element is used to create an unordered list?</h3><div class="question-answer"><ul></div><div class="question-answer"><ol></div><div class="question-answer"><li></div><div class="question-answer"><list></div></div><div class="question-container"><h3 class="question-subject">7. Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?</h3><div class="question-answer">alt</div><div class="question-answer">src</div><div class="question-answer">title</div><div class="question-answer">longdesc</div></div><div class="question-container"><h3 class="question-subject">8. What is the correct HTML element for playing video files?</h3><div class="question-answer"><video></div><div class="question-answer"><media></div><div class="question-answer"><movie></div><div class="question-answer"><play></div></div><div class="question-container"><h3 class="question-subject">9. Which HTML element is used to define important text?</h3><div class="question-answer"><strong></div><div class="question-answer"><important></div><div class="question-answer"><b></div><div class="question-answer"><i></div></div><div class="question-container"><h3 class="question-subject">10. Which HTML element is used to specify a footer for a document or section?</h3><div class="question-answer"><footer></div><div class="question-answer"><bottom></div><div class="question-answer"><section></div><div class="question-answer"><end></div></div></div><button class="quiz_start_button" onclick="quizStartButton(this)">Start Quiz</button><div class="quiz-start-reminder">We recommend that you do not leave the page that you are taking this quiz in. Stay honest 🙂</div></div> </div> <div class="suggest_next_quiz"> <div class="content">We have chosen the next challenge for you. Take the next test: </div> <ul> <li><a href="https://doquizzes.com/adhd-in-4-year-olds-quiz/"><button>ADHD in 4-Year-Olds Quiz</button></a></li> </ul> </div> <div class="quiz-share"> <h3>Can Your Friends Do Better Than You in This Quiz? </h3> <div class="description">Share this quiz with your friends and compare results.</div> <div class="share-icons"><a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdoquizzes.com%2Fhtml-quiz%2F" target="_blank" class="share-icon facebook" title="Share on Facebook"><img src="/wp-content/uploads/2024/09/FB-btn-f-b.png" alt="Facebook"></a><a href="https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fdoquizzes.com%2Fhtml-quiz%2F&media=https%3A%2F%2Fdoquizzes.com%2Fwp-content%2Fuploads%2F2024%2F10%2Fhtml-quiz-1728798159.jpg&description=HTML+Quiz" target="_blank" class="share-icon pinterest" title="Pin on Pinterest"><img src="/wp-content/uploads/2024/09/Pin-btn-f-b.png" alt="Pinterest"></a><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fdoquizzes.com%2Fhtml-quiz%2F&text=HTML+Quiz" target="_blank" class="share-icon twitter" title="Share on Twitter"><img src="/wp-content/uploads/2024/09/x-btn-f-b.png" alt="Twitter"></a><a href="https://api.whatsapp.com/send?text=HTML+Quiz https%3A%2F%2Fdoquizzes.com%2Fhtml-quiz%2F" target="_blank" class="share-icon whatsapp" title="Share on WhatsApp"><img src="/wp-content/uploads/2024/09/was-btn-f-b.png" alt="WhatsApp"></a><a href="#" onclick="copyToClipboard('https://doquizzes.com/html-quiz/'); return false;" class="share-icon copy-link" title="Copy Link"><img src="/wp-content/uploads/2024/09/link-btn-f-b.png" alt="Copy Link"></a></div> </div> <p> <script> document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll(".single #feedback-form span.feedback-flag").forEach(function (flagIcon) { flagIcon.addEventListener('click', function () { var currentURL = window.location.href; var encodedURL = encodeURIComponent(currentURL); document.cookie = "post_url=" + encodedURL + "; path=/"; var feedbackPageURL = "/feedback/"; window.location.href = feedbackPageURL; }); });</p> <p> document.querySelectorAll(".single #feedback-form .right i.fa.fa-times").forEach(function (flagIcon) { flagIcon.addEventListener('click', function () { document.querySelector(".single #feedback-form h3").style.display = "inline-block"; document.querySelector(".single #feedback-form .left .icon-container").style.display = "inline-block"; document.querySelector(".single #feedback-form span.feedback-flag").style.display = "block"; document.querySelector(".single #feedback-form .feedback-container").style.display = "none"; document.querySelector(".single #feedback-form .right i.fa.fa-times").style.display = "none"; document.querySelector(".feedback-message").textContent = ""; }); });</p> <p> document.querySelectorAll(".feedback-icon").forEach(function(icon) { icon.addEventListener('click', function() { var feedbackType = this.classList.contains("positive") ? "positive" : "negative"; var postId = 5104; </p> <p> // Perform the AJAX request fetch("https://doquizzes.com/wp-admin/admin-ajax.php", { method: "POST", headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ action: "handle_feedback", feedback: feedbackType, post_id: postId }) }) .then(response => response.json()) .then(data => { console.log('Response received:', data); console.log('Message in response:', data.message);</p> <p> document.querySelector(".single #feedback-form h3").style.display = "none"; document.querySelector(".single #feedback-form .left .icon-container").style.display = "none"; document.querySelector(".single #feedback-form span.feedback-flag").style.display = "none"; document.querySelector(".single #feedback-form .feedback-container").style.display = "block"; document.querySelector(".single #feedback-form .right i.fa.fa-times").style.display = "block"; document.querySelector(".feedback-message").textContent = data.data.message; }) .catch(error => { console.error("Error submitting feedback", error); document.querySelector(".feedback-message").textContent = "Oops! An error occurred while submitting your feedback."; }); }); }); }); </script></p> <div id="feedback-form"> <div class="left"> <div class="was-this-page">Was this page helpful?</div> <div class="icon-container"> <span class="feedback-icon positive"></span><span class="feedback-icon negative"></span> </div> <div class="feedback-container"><span class="feedback-icon message"></span><span class="feedback-message"></span></div> </div> <div class="right"> <span class="feedback-flag"></span><br /> <i class="fa fa-times" aria-hidden="true"></i> </div> </p></div> </p></div> <div class="popular-title"> <h2>More Popular Technology Quizzes:</h2> <div class="view-all"><a href="https://doquizzes.com/category/professional/technology/">View All <span class="hide">Technology</span> Quizzes</a></div> </div> <div class="top-posts-block"> <ul class="top-posts two-columns"> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/coding-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/coding-quiz-1728799388.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="coding-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/coding-quiz/">Coding Quiz</a><br /> </h3> </li> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/java-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/java-quiz-1728550804.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="java-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/java-quiz/">Java Quiz</a><br /> </h3> </li> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/linux-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/linux-quiz-1728557700.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="linux-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/linux-quiz/">Linux Quiz</a><br /> </h3> </li> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/engine-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/engine-quiz-1728559563.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="engine-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/engine-quiz/">Engine Quiz</a><br /> </h3> </li> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/google-search-game-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/google-search-game-quiz-1728792677.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="google-search-game-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/google-search-game-quiz/">Google Search Game Quiz</a><br /> </h3> </li> <li class="top-post-item"> <div class="top-post-thumbnail"> <a href="https://doquizzes.com/ai-pictures-quiz/"><img width="1" height="1" src="https://doquizzes.com/wp-content/uploads/2024/10/ai-pictures-quiz-1728576926.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="ai-pictures-quiz" decoding="async" width="150" height="150" loading="lazy" /></a></p> <div class="cat">Top Quiz</div> </div> <h3 class="top-post-title"> <a href="https://doquizzes.com/ai-pictures-quiz/">AI Pictures Quiz</a><br /> </h3> </li> </ul> <div class="carousel-arrow left-arrow"><i class="fa fa-angle-left"></i></div> <div class="carousel-arrow right-arrow"><i class="fa fa-angle-right"></i></div> </div></div> <div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:30%"> <aside class="sticky wp-block-template-part"> <div class="wp-block-group is-layout-flow wp-container-core-group-is-layout-10 wp-block-group-is-layout-flow" style="padding-right:0;padding-left:0"> <div class="wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained wp-container-3 is-position-sticky" style="margin-top:0;margin-bottom:0"> <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div> </div> </div> </aside> </div> </div> </main> <footer class="footer wp-block-template-part"> <div class="wp-block-group footer-top has-global-padding is-layout-constrained wp-container-core-group-is-layout-20 wp-block-group-is-layout-constrained" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)"> <div class="wp-block-columns alignwide is-layout-flex wp-container-core-columns-is-layout-3 wp-block-columns-is-layout-flex"> <div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%"> <div class="wp-block-group footer-content is-content-justification-space-between is-layout-flex wp-container-core-group-is-layout-19 wp-block-group-is-layout-flex"> <div class="wp-block-group mobile-fullwidth is-vertical is-content-justification-stretch is-layout-flex wp-container-core-group-is-layout-12 wp-block-group-is-layout-flex"> <div class="wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-11 wp-block-group-is-layout-flex"> <p class="title" style="font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.208), 16px);"><strong>DoQuizzes</strong></p> <nav style="font-style:normal;font-weight:400;" class="has-small-font-size is-vertical wp-block-navigation has-small-font-size is-layout-flex wp-container-core-navigation-is-layout-2 wp-block-navigation-is-layout-flex" aria-label="Footer navigation"><ul style="font-style:normal;font-weight:400;" class="wp-block-navigation__container has-small-font-size is-vertical wp-block-navigation has-small-font-size"><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/about-us/"><span class="wp-block-navigation-item__label">About Us</span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/contact-us/"><span class="wp-block-navigation-item__label">Contact Us</span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/privacy-policy/"><span class="wp-block-navigation-item__label">Privacy Policy</span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/terms-of-use/"><span class="wp-block-navigation-item__label">Terms</span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="#"><span class="wp-block-navigation-item__label">DMCA</span></a></li></ul></nav></div> </div> <div class="wp-block-group mobile-fullwidth categories-begin is-vertical is-content-justification-stretch is-layout-flex wp-container-core-group-is-layout-14 wp-block-group-is-layout-flex"> <div class="wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-13 wp-block-group-is-layout-flex"> <p class="title" style="font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.208), 16px);"><strong>Quizzes</strong></p> <nav style="font-style:normal;font-weight:400;" class="has-small-font-size is-vertical wp-block-navigation has-small-font-size is-layout-flex wp-container-core-navigation-is-layout-3 wp-block-navigation-is-layout-flex" aria-label="Footer navigation 2"><ul style="font-style:normal;font-weight:400;" class="wp-block-navigation__container has-small-font-size is-vertical wp-block-navigation has-small-font-size"><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="/category/academic/"><span class="wp-block-navigation-item__label">Academic<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="/category/automotive/"><span class="wp-block-navigation-item__label">Automotive<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="/category/education/"><span class="wp-block-navigation-item__label">Education<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/category/entertainment/"><span class="wp-block-navigation-item__label">Entertainment<span class="hide"> Quizzes</span></span></a></li></ul></nav></div> </div> <div class="wp-block-group mobile-fullwidth is-vertical is-content-justification-stretch is-layout-flex wp-container-core-group-is-layout-16 wp-block-group-is-layout-flex"> <div class="wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-15 wp-block-group-is-layout-flex"> <p class="title hide" style="font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.208), 16px);"><strong>Categories</strong></p> <nav style="font-style:normal;font-weight:400;" class="has-small-font-size is-vertical wp-block-navigation has-small-font-size is-layout-flex wp-container-core-navigation-is-layout-4 wp-block-navigation-is-layout-flex" aria-label="Footer navigation 3"><ul style="font-style:normal;font-weight:400;" class="wp-block-navigation__container has-small-font-size is-vertical wp-block-navigation has-small-font-size"><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/category/lifestyle/"><span class="wp-block-navigation-item__label">Lifestyle<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/category/pop-quizzes/"><span class="wp-block-navigation-item__label">Pop Quizzes<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/category/professional/"><span class="wp-block-navigation-item__label">Professional<span class="hide"> Quizzes</span></span></a></li><li class="has-small-font-size wp-block-navigation-item wp-block-navigation-link"><a class="wp-block-navigation-item__content" href="https://doquizzes.com/category/sports-gaming/"><span class="wp-block-navigation-item__label">Sports & Gaming<span class="hide"> Quizzes</span></span></a></li></ul></nav></div> </div> <div class="wp-block-group is-vertical is-content-justification-stretch is-layout-flex wp-container-core-group-is-layout-18 wp-block-group-is-layout-flex"> <div class="wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-17 wp-block-group-is-layout-flex"> <p class="title hide" style="font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.208), 16px);"><strong>Categories</strong></p> <nav style="font-style:normal;font-weight:400;" class="has-small-font-size is-vertical wp-block-navigation has-small-font-size is-layout-flex wp-container-core-navigation-is-layout-5 wp-block-navigation-is-layout-flex" aria-label="Footer navigation 4"></nav></div> </div> </div> </div> </div> </div> <script async data-id="101462290" src="//static.getclicky.com/js"></script> <div class="wp-block-group footer-icon-social has-global-padding is-layout-constrained wp-container-core-group-is-layout-21 wp-block-group-is-layout-constrained"> <div class="wp-block-columns footer-column-icon-social is-layout-flex wp-container-core-columns-is-layout-4 wp-block-columns-is-layout-flex"> <div class="wp-block-column footer-icon-and-social is-layout-flow wp-block-column-is-layout-flow"><div class="is-default-size wp-block-site-logo"><a href="https://doquizzes.com/" class="custom-logo-link" rel="home"><img width="220" height="34" src="https://doquizzes.com/wp-content/uploads/2024/08/logo-doquizzes.png" class="custom-logo" alt="Doquizzes" decoding="async" /></a></div> <div class="social-footer-icons"> <img decoding="async" src="/wp-content/uploads/2024/08/FB-btn-f-1.png" alt="This image has an empty alt attribute; its file name is FB-btn-f-1.png"> <img decoding="async" src="/wp-content/uploads/2024/08/Pin-btn-f.png" alt="This image has an empty alt attribute; its file name is Pin-btn-f.png"> <img decoding="async" src="/wp-content/uploads/2024/08/IG-btn-f.png" alt="This image has an empty alt attribute; its file name is IG-btn-f.png"> <img decoding="async" src="/wp-content/uploads/2024/08/yt-btn-f.png" alt="This image has an empty alt attribute; its file name is yt-btn-f.png"> <img decoding="async" src="/wp-content/uploads/2024/08/x-btn-f.png" alt="This image has an empty alt attribute; its file name is x-btn-f.png"> </div> </div> <div class="wp-block-column copyright is-layout-flow wp-block-column-is-layout-flow"> <p>©2024 DoQuizzes.com. All rights reserved.</p> </div> </div> </div> </footer></div> <style> .overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; justify-content: flex-start; align-items: flex-start; z-index: 1000; } .overlay-content { background: #13255C; padding: 20px; text-align: center; max-width: 90%; width: 100%; margin: 0 auto; } .overlay-content img { max-width: 100%; height: auto; margin-bottom: 20px; } #search-form { display: flex; height: 42px; } #search-form input[type="search"] { flex-grow: 1; padding: 10px; border: 1px solid #ccc; border-radius: 5px 0 0 5px; } #search-form button[type="submit"] { padding-top: 4px; background-color: #2B98C6; border: none; cursor: pointer; border-radius: 0 5px 5px 0; } </style> <script> document.addEventListener('DOMContentLoaded', function() { // Initialize carousel on mobile if (window.innerWidth <= 768) { const carousel = document.querySelector('.top-posts.two-columns'); const items = document.querySelectorAll('.top-post-item'); const leftArrow = document.querySelector('.left-arrow'); const rightArrow = document.querySelector('.right-arrow'); if (leftArrow && rightArrow && carousel) { //console.log("Arrows and carousel found."); // Arrow click event listeners leftArrow.addEventListener('click', function() { //console.log("Left arrow clicked."); carousel.scrollBy({ left: -carousel.clientWidth, behavior: 'smooth' }); }); rightArrow.addEventListener('click', function() { // console.log("Right arrow clicked."); carousel.scrollBy({ left: carousel.clientWidth, behavior: 'smooth' }); }); } else { console.error("Arrows or carousel not found."); } } // Overlay functionality const overlay = document.getElementById('search-overlay'); const overlayContent = document.querySelector('.overlay-content'); const triggerImage = document.querySelector('.mobile-search-button'); // Show the overlay when the image is clicked triggerImage.addEventListener('click', function() { overlay.style.display = 'flex'; }); // Close the overlay when clicking outside the overlay content overlay.addEventListener('click', function(e) { if (e.target === overlay) { overlay.style.display = 'none'; } }); }); function get_quiz_share() { let share2 = jQuery('.quiz-share .share-icons').clone() let quiz_share_elem = jQuery('<div>', {class: 'quiz-share'}) quiz_share_elem.append(share2) jQuery('#dispQuizShare').append(quiz_share_elem) } const site_current_url = window.location.href.split('?')[0] // console.log(`site_current_url: ${site_current_url}`) function update_showCurrentUrl() { let showCurrentUrl_elem = jQuery('#showCurrentUrl') if (showCurrentUrl_elem) { showCurrentUrl_elem.html(`<span class="show-current-url">${site_current_url}</span><button class="copy-link-button" onclick="copyCurrentLink(this)">Copy Link</button>`) } } function update_showRetry() { let showRetry_elem = jQuery('#showRetry') if (showRetry_elem) { showRetry_elem.html(`<a href="${site_current_url}"><button class="success-msg-end-button">Retry the quiz</button></a>`) } } function copyCurrentLink(e) { let copyTemp = document.createElement("p") copyTemp.innerText = site_current_url document.body.appendChild(copyTemp) let range = document.createRange() range.selectNodeContents(copyTemp) let sel = window.getSelection() sel.removeAllRanges() sel.addRange(range) document.execCommand('copy') document.body.removeChild(copyTemp) console.log(`Copied: ${site_current_url}`) } let afterQuizStart_intervalId function after_quiz_start() { console.log(`This is after_quiz_start`) quizTimer.startQuizTimer(); quizTimer.showQuizTimer('#timerDisplay'); startDetectPage(); afterQuizStart_intervalId = setInterval(() => { console.log(`This is afterQuizStart_intervalId`) let quiz_formidable_container_elem = jQuery('.quiz-formidable-container') if (quiz_formidable_container_elem) { let frm_message_elem = quiz_formidable_container_elem.find('.frm_message') if (frm_message_elem && frm_message_elem.length) { console.log(`This is frm_message_elem.length: ${frm_message_elem.length}`) // console.log(`This is frm_message_elem[0]: ${frm_message_elem[0]}`) clearInterval(afterQuizStart_intervalId) // get_quiz_share() // update_timeDiffDisplay() // update_showCurrentUrl() // update_showRetry() // quizTimer.stopQuizTimer() quiz_finished(); } } }, 100) } function quiz_finished() { quizTimer.stopQuizTimer() get_quiz_share() update_timeDiffDisplay() update_showCurrentUrl() update_showRetry() showDetectPageResult() showNextSuggestQuiz() // console.log(`stayInWindow? ${stayInWindow}, stayInTab? ${stayInTab}`); } let quiz_start_timestemp; function quizStartButton(e) { // quiz_start_timestemp = Date.now() // console.log(`quiz_start_timestemp: ${quiz_start_timestemp}`) after_quiz_start() // if (e) { // e.style.display = "none" // } const quiz_start_button_array = document.getElementsByClassName("quiz_start_button") quiz_start_button_array.forEach((sb) => { sb.style.display = "none" }) const start_msg_introductory_array = document.getElementsByClassName("start-msg-introductory") const start_msg_introductory = start_msg_introductory_array[0] if (start_msg_introductory) { start_msg_introductory.style.display = "none" } const question_overview_array = document.getElementsByClassName("question-overview") const question_overview = question_overview_array[0] if (question_overview) { question_overview.style.display = "none" } const quiz_formidable_container_array = document.getElementsByClassName("quiz-formidable-container") const quiz_formidable_container = quiz_formidable_container_array[0] if (quiz_formidable_container) { quiz_formidable_container.style.display= "block" } // Scroll to h1 const target = document.querySelector('h1'); if (target) { target.scrollIntoView({ behavior: 'smooth' }); } } function update_timeDiffDisplay() { let timeDiffDisplay_elem = jQuery('#timeDiffDisplay') if (timeDiffDisplay_elem) { const elapsed = quizTimer.getQuizTimeElapsed() const minutes = Math.floor(elapsed / 60) const seconds = elapsed % 60 // timeDiffDisplay_elem.html(`You completed the quiz in ${minutes}:${seconds < 10 ? '0' : ''}${seconds}`) let scoreRow = jQuery('.frm_quizzes_result tr')[0]; if(scoreRow) { jQuery(`<tr class="time"><td colspan=2>You completed the quiz in ${minutes}:${seconds < 10 ? '0' : ''}${seconds}</td></tr>`).insertAfter(scoreRow); } } let timerDisplay_elem = jQuery('#timerDisplay') if (timerDisplay_elem) { // timerDisplay_elem.hide() // timerDisplay_elem.css({display: "none"}) timerDisplay_elem.remove() } } let stayInTab = true; let stayInWindow = true; function startDetectPage() { stayintab = true; document.addEventListener("visibilitychange", () => { if (document.hidden) { stayInTab = false; console.log("document hidden"); } else { // Resume playing if audio was "playing on hide" } }); stayInWindow = true; window.addEventListener("blur", () => { stayInWindow = false; console.log("window blur"); }) } function showDetectPageResult() { if(!(stayInTab && stayInWindow)) { let result = jQuery('.frm_quizzes_result')[0]; //the answer table if(result) { jQuery(`<div class="not_focus">We detected that you left the page whilst taking the quiz; did you look up the answer?</div>`).insertBefore(result); } } } function showNextSuggestQuiz() { let nextQuiz = jQuery('.suggest_next_quiz')[0]; if(nextQuiz) { let frmMessage = jQuery('.frm_message')[0]; if(frmMessage) { frmMessage.after(nextQuiz); } } } </script> <script type="text/javascript"> document.addEventListener('DOMContentLoaded', function() { const menuItems = document.querySelectorAll('li.wp-block-navigation-submenu'); const submenuItems = document.querySelectorAll('ul.wp-block-navigation-submenu li'); menuItems.forEach(function(item) { item.addEventListener('mouseenter', function() { const submenu = item.querySelector('ul.wp-block-navigation-submenu'); if (submenu) { submenu.classList.add('show-submenu'); } }); item.addEventListener('mouseleave', function() { const submenu = item.querySelector('ul.wp-block-navigation-submenu'); if (submenu) { submenu.classList.remove('show-submenu'); } }); }); // Initialize carousel on mobile for featured posts const featuredCarousel = document.querySelector('.featured-posts.two-columns'); const leftArrowFeatured = document.querySelector('.carousel-arrow-featured.left-arrow'); const rightArrowFeatured = document.querySelector('.carousel-arrow-featured.right-arrow'); if (leftArrowFeatured && rightArrowFeatured && featuredCarousel) { // Add arrow click event listeners for the featured posts carousel leftArrowFeatured.addEventListener('click', function() { featuredCarousel.scrollBy({ left: -featuredCarousel.clientWidth, // Scroll left by the width of the carousel behavior: 'smooth' }); }); rightArrowFeatured.addEventListener('click', function() { featuredCarousel.scrollBy({ left: featuredCarousel.clientWidth, // Scroll right by the width of the carousel behavior: 'smooth' }); }); } else { //console.error("Featured arrows or carousel not found."); } // Initialize carousel on mobile for featured posts const featuredCarouseltop = document.querySelector('.top-posts.two-columns'); const leftArrowFeaturedtop = document.querySelector('.carousel-arrow.left-arrow'); const rightArrowFeaturedtop = document.querySelector('.carousel-arrow.right-arrow'); if (leftArrowFeaturedtop && rightArrowFeaturedtop && featuredCarouseltop) { // Add arrow click event listeners for the featured posts carousel leftArrowFeaturedtop.addEventListener('click', function() { featuredCarouseltop.scrollBy({ left: -featuredCarouseltop.clientWidth, // Scroll left by the width of the carousel behavior: 'smooth' }); }); rightArrowFeaturedtop.addEventListener('click', function() { featuredCarouseltop.scrollBy({ left: featuredCarouseltop.clientWidth, // Scroll right by the width of the carousel behavior: 'smooth' }); }); } else { //console.error("top Posts arrows or carousel not found."); } // Initialize carousel on mobile for featured posts const featuredCarouselset = document.querySelector('.featured-posts.two-columns.set'); const leftArrowFeaturedset = document.querySelector('.carousel-arrow-featured.left-arrow.set'); const rightArrowFeaturedset = document.querySelector('.carousel-arrow-featured.right-arrow.set'); if (leftArrowFeaturedset && rightArrowFeaturedset && featuredCarouselset) { // Add arrow click event listeners for the featured posts carousel leftArrowFeaturedset.addEventListener('click', function() { featuredCarouselset.scrollBy({ left: -featuredCarouselset.clientWidth, // Scroll left by the width of the carousel behavior: 'smooth' }); }); rightArrowFeaturedset.addEventListener('click', function() { featuredCarouselset.scrollBy({ left: featuredCarouselset.clientWidth, // Scroll right by the width of the carousel behavior: 'smooth' }); }); } else { //console.error("top Posts arrows or carousel not found."); } // Initialize carousel on mobile for featured posts const featuredCarouselcat = document.querySelector('.featured-posts.two-columns.categories'); const leftArrowFeaturedcat = document.querySelector('.carousel-arrow-featured.left-arrow.categories'); const rightArrowFeaturedcat = document.querySelector('.carousel-arrow-featured.right-arrow.categories'); if (leftArrowFeaturedcat && rightArrowFeaturedcat && featuredCarouselcat) { // Add arrow click event listeners for the featured posts carousel leftArrowFeaturedcat.addEventListener('click', function() { featuredCarouselcat.scrollBy({ left: -featuredCarouselcat.clientWidth, // Scroll left by the width of the carousel behavior: 'smooth' }); }); rightArrowFeaturedcat.addEventListener('click', function() { featuredCarouselcat.scrollBy({ left: featuredCarouselcat.clientWidth, // Scroll right by the width of the carousel behavior: 'smooth' }); }); } else { //console.error("top Posts arrows or carousel not found."); } // Remove 'has-child' class from submenu items submenuItems.forEach(function(subItem) { if (subItem.classList.contains('has-child')) { subItem.classList.remove('has-child'); } // Ensure submenu items are clickable subItem.addEventListener('click', function(event) { // Prevent default action to avoid interference event.stopPropagation(); }); }); }); </script> <script> class QuizTimer { constructor() { this.startTime = null; this.stopTime = null; this.intervalId = null; this.displayElement = null; } startQuizTimer() { if (this.startTime === null) { this.startTime = Date.now(); this.intervalId = setInterval(() => { this.updateTimerDisplay(); }, 1000); } } stopQuizTimer() { clearInterval(this.intervalId); this.intervalId = null; this.stopTime = Date.now(); } showQuizTimer(selector) { this.displayElement = document.querySelector(selector); if (this.displayElement) { this.displayElement.style.display = 'block'; this.updateTimerDisplay(); } else { // console.error(`Element with selector "${selector}" not found.`); } } hideQuizTimer() { if (this.displayElement) { this.displayElement.style.display = 'none'; } } getQuizTimeElapsed() { if (this.startTime === null) { return 0; } const currentTime = this.stopTime || Date.now(); return Math.floor((currentTime - this.startTime) / 1000); } updateTimerDisplay() { if (this.displayElement) { const elapsed = this.getQuizTimeElapsed(); const minutes = Math.floor(elapsed / 60); const seconds = elapsed % 60; this.displayElement.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`; } } } const quizTimer = new QuizTimer(); // document.addEventListener('DOMContentLoaded', function() { // const quizTimer = new QuizTimer(); // // Function to start the quiz timer // function startQuiz() { // quizTimer.startQuizTimer(); // quizTimer.showQuizTimer('#timerDisplay'); // Ensure #timerDisplay exists in your HTML // } // // Add event listener to the start button // const startButton = document.querySelector('.quiz_start_button'); // if (startButton) { // startButton.addEventListener('click', startQuiz); // } // // Optionally, check if quiz-formidable-container is displayed // const checkQuizContainer = () => { // const container = document.querySelector('.quiz-formidable-container'); // if (container && container.style.display === 'block') { // startQuiz(); // } // }; // // You might want to run this check periodically or attach it to a mutation observer // setInterval(checkQuizContainer, 1000); // Check every second (adjust as needed) // }); </script> <script id="wp-block-template-skip-link-js-after"> ( function() { var skipLinkTarget = document.querySelector( 'main' ), sibling, skipLinkTargetID, skipLink; // Early exit if a skip-link target can't be located. if ( ! skipLinkTarget ) { return; } /* * Get the site wrapper. * The skip-link will be injected in the beginning of it. */ sibling = document.querySelector( '.wp-site-blocks' ); // Early exit if the root element was not found. if ( ! sibling ) { return; } // Get the skip-link target's ID, and generate one if it doesn't exist. skipLinkTargetID = skipLinkTarget.id; if ( ! skipLinkTargetID ) { skipLinkTargetID = 'wp--skip-link--target'; skipLinkTarget.id = skipLinkTargetID; } // Create the skip link. skipLink = document.createElement( 'a' ); skipLink.classList.add( 'skip-link', 'screen-reader-text' ); skipLink.href = '#' + skipLinkTargetID; skipLink.innerHTML = 'Skip to content'; // Inject the skip link. sibling.parentElement.insertBefore( skipLink, sibling ); }() ); </script> <script src="https://doquizzes.com/wp-content/plugins/contact-form-7/includes/swv/js/index.js?ver=5.9.8" id="swv-js"></script> <script id="contact-form-7-js-extra"> var wpcf7 = {"api":{"root":"https:\/\/doquizzes.com\/wp-json\/","namespace":"contact-form-7\/v1"}}; </script> <script src="https://doquizzes.com/wp-content/plugins/contact-form-7/includes/js/index.js?ver=5.9.8" id="contact-form-7-js"></script> <script id="wp-posts-view-script-js-extra"> var wp_post_views_ajax_object = {"ajaxurl":"https:\/\/doquizzes.com\/wp-admin\/admin-ajax.php","nonce":"46ba0c0060","post_id":"5104"}; </script> <script src="https://doquizzes.com/wp-content/plugins/wp-post-views//assets/js/ajax.js?ver=6.6.2" id="wp-posts-view-script-js"></script> <script id="formidable-js-extra"> var frm_js = {"ajax_url":"https:\/\/doquizzes.com\/wp-admin\/admin-ajax.php","images_url":"https:\/\/doquizzes.com\/wp-content\/plugins\/formidable\/images","loading":"Loading\u2026","remove":"Remove","offset":"4","nonce":"e0063bc359","id":"ID","no_results":"No results match","file_spam":"That file looks like Spam.","calc_error":"There is an error in the calculation in the field with key","empty_fields":"Please complete the preceding required fields before uploading a file.","focus_first_error":"1","include_alert_role":"1","include_resend_email":""}; var frm_password_checks = {"eight-char":{"label":"Eight characters minimum","regex":"\/^.{8,}$\/","message":"Passwords require at least 8 characters"},"lowercase":{"label":"One lowercase letter","regex":"#[a-z]+#","message":"Passwords must include at least one lowercase letter"},"uppercase":{"label":"One uppercase letter","regex":"#[A-Z]+#","message":"Passwords must include at least one uppercase letter"},"number":{"label":"One number","regex":"#[0-9]+#","message":"Passwords must include at least one number"},"special-char":{"label":"One special character","regex":"\/(?=.*[^a-zA-Z0-9])\/","message":"Password is invalid"}}; var frmCheckboxI18n = {"errorMsg":{"min_selections":"This field requires a minimum of %1$d selected options but only %2$d were submitted."}}; </script> <script src="https://doquizzes.com/wp-content/plugins/formidable-pro/js/frm.min.js?ver=6.14" id="formidable-js"></script> <script id="formidable-js-after"> window.frm_js.repeaterRowDeleteConfirmation = "Are you sure you want to delete this row?"; </script> <script> /*<![CDATA[*/ /*]]>*/ </script> </body> </html>