HTML Input Types

Alright, so you’ve got the <form> tag down, and you’ve probably played with <input> a bit. That’s a solid base, but here’s where it gets fun: the <input> tag isn’t just one trick. Change its type, and it transforms into all sorts of cool things. I remember when I first stumbled onto this. It was like finding a box of crayons after sketching with just a pencil. Suddenly, my forms weren’t boring anymore. Let’s crack open some of these input types and see what they can do!

Start with the classic: <input type="text">. It’s your basic text box.

Simple, but it works:

<input type="text" name="name" placeholder="Your name">

That placeholder is a little hint inside the box. I’ve used it to nudge folks, like “Type your fave song here”. Then there’s:

<input type="email" name="email">

It’s picky, only happy with email-looking stuff like “me@example.com”. I messed up once, typed gibberish, and it called me out. Smart, right?

Next, password input; It hides what you type:

<input type="password" name="pass">

Perfect for logins. I tested it with my cat’s name as a password, and those dots felt so secretive.

<input type="checkbox" name="topping" value="cheese"> Cheese

Check it, and “cheese” gets sent. I made a pizza form with these once, piling on toppings like a mad chef.

Then there’s Radio for one-choice picks:

<input type="radio" name="size" value="small"> Small
<input type="radio" name="size" value="large"> Large

Same name means only one gets picked. I used this for a “Pick your mood” quiz, and it felt so clean. Oh, and

<input type="submit" value="Go">

It’s the “send it” button. There’s tons more, like type="number" or type="date", but start here.

Mix them up next time you’re coding:

<form>
<input type="text" name="user" placeholder="Who are you?">
<input type="password" name="secret">
<input type="submit" value="Login">
</form>

It’s a little login, all yours to tweak. I learned fast: test them in a browser to see the quirks. It’s like giving your form a personality upgrade!

How-To Guides for HTML

No How-To Guide is available right now.

Keep Learning & Level Up!

Enhance your HTML skills with our in-depth tutorials and interactive quizzes.

Explore HTML Quiz