HTML HTML Basic MCQ Question #4781
MCQ Single Best Answer Not Set

Q12. How do we write HTML comments?

ID: #4781 HTML Basic MCQ 185 views
Question Info
#4781Q ID
Not SetDifficulty
HTML Basic MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A
    
    <</span>
                                <span class="option-status correct-option">✔</span>
                                <span class="option-status wrong-option">✖</span>
                            </li>
                                                <li class="options-list-item" data-qid="4781">
                                <span class="option-symbol">B</span>
                                <span class="option-text"><pre class = "prettyprint"><xmp>
    <!</span>
                                <span class="option-status correct-option">✔</span>
                                <span class="option-status wrong-option">✖</span>
                            </li>
                                                <li class="options-list-item" data-qid="4781">
                                <span class="option-symbol">C</span>
                                <span class="option-text"><pre class = "prettyprint"><xmp>
    </</span>
                                <span class="option-status correct-option">✔</span>
                                <span class="option-status wrong-option">✖</span>
                            </li>
                                                <li class="options-list-item" data-qid="4781">
                                <span class="option-symbol">D</span>
                                <span class="option-text"><pre class = "prettyprint"><xmp>
    </</span>
                                <span class="option-status correct-option">✔</span>
                                <span class="option-status wrong-option">✖</span>
                            </li>
                                        </ul>
                </div>
    
                <!-- Hidden correct answer anchor -->
                <span id="correct-option4781" style="display:none;">
                    B            </span>
    
                <!-- ── Answer / Explanation Card ── -->
                <div id="answer-box-4781" class="mcq-card mcq-answer-card">
                    <div class="answer-badge">
                        <i class="fa fa-check-circle"></i>
                        Correct Answer: Option B                </div>
                    <h3 class="section-title">Explanation</h3>
                    <div class="answer-explanation">
                         
    <p>Browsers will ignore comments in a code, and comments are used to add notes or explanations to the code for the benefit of the developer or other users who may be reading the code. <br>There are two types of comments in HTML: single line comments, which are denoted by the <!-- and --> characters, and multiple line comments, which are denoted by the /* and */ characters.<br> To add a comment in the code, you can place the text between these characters and it will not be visible in the user's browser. <br>Comments are a useful tool for organizing and documenting code, and they can help make it easier to understand and maintain.</p>                </div>
                </div>
    
                <!-- ── Prev / Next Navigation ── -->
                <div class="mcq-card">
                    <div class="section-label"><i class="fa fa-arrow-right-arrow-left"></i> &nbsp;Continue Practice</div>
                    <div class="mcq-nav-row" style="margin-top:12px;">
                                                <a href="/question/mcq/4780" class="nav-btn">
                                <i class="fa fa-arrow-left"></i> Previous Question
                            </a>
                        
                                                <a href="/question/mcq/4782" class="nav-btn nav-next">
                                Next Question <i class="fa fa-arrow-right"></i>
                            </a>
                                        </div>
                </div>
    
                <!-- ── Share Card ── -->
                <div class="mcq-card">
                    <div class="section-label"><i class="fa fa-share-nodes"></i> &nbsp;Share</div>
                    <h3 class="section-title" style="margin-bottom:4px;">Share This Question</h3>
                    <p class="section-sub">Challenge a friend or share with your study group.</p>
                    <div class="share-actions">
                        <a target="_blank"
                           href="https://api.whatsapp.com/send?text=Check+this+MCQ%3A+https%3A%2F%2Fwww.rummanansari.com%2Fquestion%2Fmcq%2F4781"
                           class="share-btn share-btn-wa">
                            <i class="fa-brands fa-whatsapp"></i> WhatsApp
                        </a>
                        <button type="button" class="share-btn" id="copyQuestionLinkBtn">
                            <i class="fa fa-copy"></i> Copy Link
                        </button>
                    </div>
                </div>
    
                <!-- ── Related Questions (main col, mobile visible) ── -->
                            <div class="mcq-card">
                    <div class="section-label"><i class="fa fa-circle-question"></i> &nbsp;More from This Topic</div>
                    <h2 class="section-title" style="margin-bottom:16px;">Related MCQ Questions</h2>
                    <div class="related-q-list">
                                                <a href="/question/mcq/4143" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                The correct sequence of HTML tags for starting a webpage is                        </a>
                                                <a href="/question/mcq/4141" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                HTML stands for                        </a>
                                                <a href="/question/mcq/4773" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                Who is the originator of HTML?                        </a>
                                                <a href="/question/mcq/4813" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                What does the HTML5 &amp;amp;lt;address&amp;amp;gt; element serve? 
                             </a>
                                                <a href="/question/mcq/4142" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                HTML files are saved by default with the extension?                        </a>
                                                <a href="/question/mcq/4795" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                Which character does an HTML tag&#039;s closure represent?                        </a>
                                                <a href="/question/mcq/4797" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                In HTML, how do you add a background colour?                        </a>
                                                <a href="/question/mcq/4805" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                What other sorts of bulleted or unordered lists are there in HTML?                        </a>
                                                <a href="/question/mcq/4793" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                Which of the following HTML Elements is used for making any text bold ?
                            </a>
                                                <a href="/question/mcq/4786" class="related-q-item">
                                <i class="fa fa-chevron-right"></i>
                                HTML is a subset of HTML.                        </a>
                                        </div>
                </div>
                
            </main>
    
            <!-- ════════════════════════════════════════════════
                 RIGHT COLUMN — Subject enroll + Related Topics
            ════════════════════════════════════════════════ -->
            <aside class="mcq-right-col">
    
                <!-- ── Subject Enrollment Card ── -->
                <div class="subject-card">
                    <div class="subject-card-header">
                        <div class="subject-icon-wrap">
                                                        <i class="fa fa-graduation-cap" style="color:rgba(13,110,253,.7);"></i>
                                                </div>
                        <h3 class="subject-name">Computer Science and Engineering</h3>
                                                <p class="subject-desc">Explore the dynamic field of Computer Science and Engineering with our comprehensive course. Learn about algorithms, dat…</p>
                                        </div>
                    <div class="subject-card-body">
                        
                                                <a href="/payment/enroll/7" class="btn-enroll">
                                <i class="fa fa-plus-circle"></i> Enroll in Subject
                            </a>
                                        </div>
                </div>
    
                <!-- ── Related Topics Card ── -->
                            <div class="mcq-card" style="padding:18px 16px;">
                    <div class="section-label" style="margin-bottom:12px;">
                        <i class="fa fa-sitemap"></i> &nbsp;Related Topics
                    </div>
                                        <a href="/article/read/7/319"
                           class="right-topic-link active">
                            <i class="fa fa-circle-dot"></i>
                            HTML Basic MCQ                    </a>
                                        <a href="/article/read/7/335"
                           class="right-topic-link ">
                            <i class="fa fa-circle"></i>
                            HTML List MCQ                    </a>
                                        <a href="/article/read/7/320"
                           class="right-topic-link ">
                            <i class="fa fa-circle"></i>
                            Structuring Web Documents MCQ                    </a>
                                </div>
                
            </aside>
    
        </div><!-- /.mcq-layout -->
    </div>
    
    <style>
    footer.site-footer,
    footer.site-footer a,
    footer.site-footer li,
    footer.site-footer p,
    footer.site-footer span,
    footer.site-footer h5,
    .navbar .dropdown-menu,
    .navbar .dropdown-menu a,
    .navbar .dropdown-menu li,
    .navbar .dropdown-menu p {
        color: var(--text-color) !important;
        background-color: var(--header-footer-bg) !important;
    }
    
    footer.site-footer a:hover,
    .navbar .dropdown-menu a:hover {
        color: var(--link-hover-color) !important;
    }
    
    footer.site-footer hr {
        border-color: var(--shadow-color) !important;
    }
    
    footer.site-footer i {
        color: var(--text-color) !important;
    }
    
    footer.site-footer i:hover {
        color: var(--link-hover-color) !important;
    }
    
    .site-footer {
        padding: 48px 24px 24px;
        margin-top: 40px;
        border-top: 1px solid var(--border-color);
    }
    
    .site-footer .footer-inner {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .site-footer .footer-top {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px;
    }
    
    .site-footer h5 {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 16px;
    }
    
    .site-footer p,
    .site-footer li,
    .site-footer a {
        font-size: 0.98rem;
        line-height: 1.7;
        text-decoration: none;
    }
    
    .site-footer ul {
        padding-left: 0;
        margin-bottom: 0;
        list-style: none;
    }
    
    .site-footer .social-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 14px;
        font-size: 1rem;
    }
    
    .site-footer .footer-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding-top: 20px;
        margin-top: 28px;
        border-top: 1px solid var(--shadow-color);
    }
    
    .site-footer .footer-bottom-links a {
        margin-left: 18px;
    }
    
    .site-footer .footer-bottom-links a:first-child {
        margin-left: 0;
    }
    
    @media (max-width: 991.98px) {
        .site-footer {
            padding: 36px 16px 20px;
        }
    
        .site-footer .footer-top {
            grid-template-columns: 1fr;
            gap: 24px;
        }
    
        .site-footer .footer-bottom {
            flex-direction: column;
            align-items: flex-start;
        }
    
        .site-footer .footer-bottom-links a {
            margin-left: 0;
            margin-right: 16px;
        }
    }
    </style>
    
    <footer class="site-footer">
        <div class="footer-inner">
            <div class="footer-top">
                <div>
                    <h3>About RummanAnsari</h3>
                    <p>Your go-to platform for online courses, GK, blogs, and learning resources.</p>
                </div>
    
                <div>
                    <h3>Quick Links</h3>
                    <ul>
                        <li><a href="/">Home</a></li>
                        <li><a href="/blog/">Blog</a></li>
                        <li><a href="https://www.rummanansari.com/course?course_type=paid">Topic</a></li>
                        <li><a href="/course">Courses</a></li>
                    </ul>
                </div>
    
                <div>
                    <h3>Courses</h3>
                    <ul>
                        <li><a href="https://www.rummanansari.com/course?course_type=free">Free Courses</a></li>
                        <li><a href="https://www.rummanansari.com/course?course_type=paid">Paid Courses</a></li>
                    </ul>
    
                    <h3 class="mt-4">Connect with Us</h3>
                    <div class="social-links">
                        <a href="https://www.facebook.com/merummanansari/" aria-label="Facebook Profile"><i class="fab fa-facebook-f"></i></a>
                        <a href="https://x.com/merummanansari" aria-label="Twitter Profile"><i class="fab fa-twitter"></i></a>
                        <a href="https://www.linkedin.com/in/rummanansari/" aria-label="LinkedIn Profile"><i class="fab fa-linkedin-in"></i></a>
                        <a href="https://www.instagram.com/instra.ansari/" aria-label="Instagram Profile"><i class="fab fa-instagram"></i></a>
                    </div>
                </div>
            </div>
    
            <div class="footer-bottom">
                <p class="mb-0">&copy; 2026 RummanAnsari. All rights reserved.</p>
                <div class="footer-bottom-links">
                    <a href="/about/">About</a>
                    <a href="/about/privacy-policy/">Privacy</a>
                    <a href="/about/terms-and-conditions/">Terms</a>
                </div>
            </div>
        </div>
    </footer>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
    <!--<script src="/assets/js/new-scripts.js"></script>-->
    
    <!--  below two for editor-->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.css" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.js"></script>
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    <script>
    document.addEventListener('DOMContentLoaded', function () {
        const body = document.body;
        const toggleBtn = document.getElementById('sidebarToggleBtn');
        const closeBtn = document.getElementById('closeSidebarBtn');
        const overlay = document.getElementById('sidebarOverlay');
        const mobileBreakpoint = 992;
    
        function isMobile() {
            return window.innerWidth < mobileBreakpoint;
        }
    
        function applySidebarState() {
            const saved = localStorage.getItem('sidebarCollapsed');
    
            if (isMobile()) {
                body.classList.remove('sidebar-collapsed');
                body.classList.remove('sidebar-mobile-open');
            } else {
                body.classList.remove('sidebar-mobile-open');
    
                if (saved === 'true') {
                    body.classList.add('sidebar-collapsed');
                } else {
                    body.classList.remove('sidebar-collapsed');
                }
            }
        }
    
        if (toggleBtn) {
            toggleBtn.addEventListener('click', function () {
                if (isMobile()) {
                    body.classList.toggle('sidebar-mobile-open');
                } else {
                    body.classList.toggle('sidebar-collapsed');
                    localStorage.setItem(
                        'sidebarCollapsed',
                        body.classList.contains('sidebar-collapsed') ? 'true' : 'false'
                    );
                }
            });
        }
    
        if (closeBtn) {
            closeBtn.addEventListener('click', function () {
                body.classList.remove('sidebar-mobile-open');
            });
        }
    
        if (overlay) {
            overlay.addEventListener('click', function () {
                body.classList.remove('sidebar-mobile-open');
            });
        }
    
        window.addEventListener('resize', applySidebarState);
        applySidebarState();
    });
    
    document.addEventListener('DOMContentLoaded', function () {
        const body = document.body;
        const themeButtons = document.querySelectorAll('[data-theme-button]');
    });
    </script>
    
     <script type="module">
    // import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-app.js";
    // import { getAuth, GoogleAuthProvider, signInWithPopup } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-auth.js";
    
    // const firebaseConfig = {
    //     apiKey: "AIzaSyCNteyUk6yYXnx275jqn09fGPtjpnir5pY",
    //     authDomain: "rummanansari-01.firebaseapp.com",
    //     projectId: "rummanansari-01",
    //     storageBucket: "rummanansari-01.firebasestorage.app",
    //     messagingSenderId: "958581859518",
    //     appId: "1:958581859518:web:ea2b17c10640eb8747eaef"
    // };
    
    // const app = initializeApp(firebaseConfig);
    // const auth = getAuth(app);
    // const provider = new GoogleAuthProvider();
    
    // document.getElementById('googleLoginBtn').addEventListener('click', async function () {
    //     try {
    //         const result = await signInWithPopup(auth, provider);
    //         const user = result.user;
    
    //         const response = await fetch('/login/google', {
    //             method: 'POST',
    //             headers: {
    //                 'Content-Type': 'application/json'
    //             },
    //             body: JSON.stringify({
    //                 email: user.email || '',
    //                 first_name: user.displayName ? user.displayName.split(' ')[0] : '',
    //                 last_name: user.displayName ? user.displayName.split(' ').slice(1).join(' ') : '',
    //                 profile_image: user.photoURL || ''
    //             })
    //         });
    
    //         const rawText = await response.text();
    //         console.log('Server response:', rawText);
    
    //         let data;
    //         try {
    //             data = JSON.parse(rawText);
    //         } catch (e) {
    //             alert('Server is not returning valid JSON. Check console.');
    //             return;
    //         }
    
    //         if (data.status === 'success') {
    //             window.location.href = data.redirect || '/dashboard';
    //         } else {
    //             alert(data.message || 'Google login failed.');
    //         }
    //     } catch (error) {
    //         console.error('Google login error:', error);
    //         alert(error.message || 'Unable to login with Google.');
    //     }
    // });
    </script>
    
    <script type="module">
    import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-app.js";
    import { getAuth, GoogleAuthProvider, signInWithPopup } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-auth.js";
    
    const firebaseConfig = {
        apiKey: "AIzaSyCNteyUk6yYXnx275jqn09fGPtjpnir5pY",
        authDomain: "rummanansari-01.firebaseapp.com",
        projectId: "rummanansari-01",
        storageBucket: "rummanansari-01.firebasestorage.app",
        messagingSenderId: "958581859518",
        appId: "1:958581859518:web:ea2b17c10640eb8747eaef"
    };
    
    const app = initializeApp(firebaseConfig);
    const auth = getAuth(app);
    const provider = new GoogleAuthProvider();
    
    const googleLoginButtons = document.querySelectorAll('.googleLoginBtn');
    
    googleLoginButtons.forEach(function (googleLoginBtn) {
        googleLoginBtn.addEventListener('click', async function () {
            try {
                const result = await signInWithPopup(auth, provider);
                const user = result.user;
    
                const response = await fetch('/login/google', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify({
                        email: user.email || '',
                        first_name: user.displayName ? user.displayName.split(' ')[0] : '',
                        last_name: user.displayName ? user.displayName.split(' ').slice(1).join(' ') : '',
                        profile_image: user.photoURL || '',
                        google_uid: user.uid
                    })
                });
    
                const rawText = await response.text();
                console.log('Server response:', rawText);
    
                let data;
                try {
                    data = JSON.parse(rawText);
                } catch (e) {
                    alert('Server is not returning valid JSON. Check console.');
                    return;
                }
    
                if (data.status === 'success') {
                    window.location.href = data.redirect || '/dashboard';
                } else {
                    alert(data.message || 'Google login failed.');
                }
    
            } catch (error) {
                console.error('Google login error:', error);
                alert(error.message || 'Unable to login with Google.');
            }
        });
    });
    </script>
    
    </body>
    </html>
    <script>
    document.addEventListener("DOMContentLoaded", function () {
    
        /* ── Option click handler (all existing logic preserved) ── */
        const optionItems = document.querySelectorAll(".options-list-item");
    
        optionItems.forEach(function (item) {
            item.addEventListener("click", function () {
                const qid      = this.getAttribute("data-qid");
                const selected = this.querySelector(".option-symbol").innerText.trim();
                const correctEl = document.getElementById("correct-option" + qid);
                const answerBox = document.getElementById("answer-box-" + qid);
    
                if (!correctEl || !answerBox) return;
    
                const correct  = correctEl.innerText.trim();
                const allItems = document.querySelectorAll("[data-qid='" + qid + "']");
    
                allItems.forEach(function (li) {
                    li.classList.remove("selected", "correct-selected", "wrong-selected");
                    const ok   = li.querySelector(".correct-option");
                    const fail = li.querySelector(".wrong-option");
                    if (ok)   ok.style.display   = "none";
                    if (fail) fail.style.display  = "none";
                });
    
                this.classList.add("selected");
    
                if (selected === correct) {
                    this.classList.add("correct-selected");
                    const ok = this.querySelector(".correct-option");
                    if (ok) ok.style.display = "inline";
                    answerBox.style.display = "block";
                    setTimeout(function () {
                        window.scrollTo({ top: answerBox.offsetTop - 90, behavior: "smooth" });
                    }, 120);
                } else {
                    this.classList.add("wrong-selected");
                    const fail = this.querySelector(".wrong-option");
                    if (fail) fail.style.display = "inline";
                }
            });
        });
    
        /* ── Copy link button ── */
        const copyBtn = document.getElementById("copyQuestionLinkBtn");
        if (copyBtn) {
            copyBtn.addEventListener("click", function () {
                navigator.clipboard.writeText(window.location.href).then(function () {
                    const orig = copyBtn.innerHTML;
                    copyBtn.innerHTML = '<i class="fa fa-check"></i> Copied!';
                    setTimeout(function () { copyBtn.innerHTML = orig; }, 1400);
                });
            });
        }
    
        /* ── Active topic highlight in right sidebar ── */
        document.querySelectorAll(".right-topic-link.active").forEach(function(el){
            el.style.borderColor = "rgba(13,110,253,.35)";
            el.style.background  = "rgba(13,110,253,.07)";
            el.style.color       = "var(--link-color)";
        });
    
    });
    </script>