CODE PATH
PRO ACCOUNT

Master Code
On The Go

Learn. Practice. Build.

Quest 1 β€’ Lesson 5

πŸ“ Forms & Inputs

HTML forms collect user input – search boxes, login fields, contact messages. The <form> element wraps all input elements, and <input> defines the field type.

"Forms are the bridge between users and your website. They enable interaction, searches, and data submission."
form.html
<form action="/submit" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name">
  <button type="submit">Send</button>
</form>

🧠 Form Elements Explained

πŸŽ›οΈ Common Input Types

text

email

password

number

πŸ”˜ Radio Buttons & Checkboxes

Radio (select one):
Checkbox (select multiple):
<input type="radio" name="gender" value="male"> Male

πŸš€ Live Demo: Contact Form

Fill out the form and click "Submit" – see the data in the console (right‑click β†’ Inspect β†’ Console).

πŸ“˜ JavaScript used (only for demo)
function handleFormSubmit(event) {
    event.preventDefault();
    const formData = new FormData(event.target);
    console.log("Form data:", Object.fromEntries(formData));
    document.getElementById('formFeedback').classList.remove('hidden');
}

✨ Challenge: Build a Survey Form

Create a simple survey with:

❀️ Support Free Education

This course is 100% free. If it helps you, consider buying me a coffee.

β˜• Buy Me a Coffee

➑️ Ready for more?

Next lesson: Semantic HTML & Accessibility – build better websites.

Continue to Lesson 1.6 β†’

(Coming soon – check back or buy Pro Pack for instant access)