Skip to main content
Creative Coding Projects

Valentine's Day Quiz: How Well Do You Know Me? — HTML & JavaScript

Build a fun Valentine's Day quiz website to test how well your partner knows you. Customizable questions, score tracking, and shareable results.

G

gs_admin

Author & Reviewer

Published

Jul 16, 2026

Read Time

11 min read

love.html
💝
Creative Coding Projects

🎯 What You'll Build

A fun, interactive quiz that tests how well your partner knows you. Custom questions, animated score tracking, and a personalized result message based on their score!

---

📦 Get the Source Code

> ☕ Download on Buy Me a Coffee →

---

🛠️ Quiz Engine

javascript
12345678910111213141516171819202122232425262728293031323334353637383940414243
const questions = [
    {
        question: "What's my favorite food?",
        options: ["Pizza 🍕", "Sushi 🍣", "Tacos 🌮", "Pasta 🍝"],
        correct: 0
    },
    {
        question: "Where did we first meet?",
        options: ["Coffee shop ☕", "College 🎓", "Online 💻", "Party 🎉"],
        correct: 1
    },
    // Add your own questions!
];

let currentQuestion = 0;
let score = 0;

function loadQuestion() {
    const q = questions[currentQuestion];
    document.getElementById('question').textContent = q.question;
    
    const optionsHtml = q.options.map((opt, i) => 
        `<button onclick="answer(${i})" class="option-btn">${opt}</button>`
    ).join(&#039;&#039;);
    
    document.getElementById(&#039;options&#039;).innerHTML = optionsHtml;
    document.getElementById(&#039;progress&#039;).textContent = 
        `${currentQuestion + 1} / ${questions.length}`;
}

function answer(index) {
    if (index === questions[currentQuestion].correct) {
        score++;
        // Show correct animation
    }
    
    currentQuestion++;
    if (currentQuestion < questions.length) {
        loadQuestion();
    } else {
        showResults();
    }
}

---

G

About the Author: gs_admin

A senior technical contributor specializing in architectural designs, software optimization, database structures, and developer education. Passionate about writing clean code and sharing engineering knowledge.