Check out a free preview of the full HTML Forms course
The "Placeholder" Lesson is part of the full, HTML Forms course featured in this preview video. Here's what you'd learn in this lesson:
Jen demonstrates how to put placeholder text within an input field.
Transcript from the "Placeholder" Lesson
[00:00:00]
>> Jen Kramer: What if we wanna have some sort of information in these text areas by default, okay? We can do that too. Let's scroll back on up to the top of our form, up here in the,
>> Jen Kramer: Let's say for your phone number, okay? For your phone number.
>> Jen Kramer: In the input for the phone number, I'm back on line 19, we may want to go ahead and put something here, like placeholder.
[00:00:33]
That is the attribute, and then inside of placeholder you can put whatever you want to show in that field, so like don't forget your area code. So placeholder is a way that you can make some text appear in those, like phone, the text, the email. If you want something to show up in those fields by default, that's the way you can go about doing it.
[00:01:01]
And when you refresh the page, you'll see it's there in very pale text. And when you click in there and start typing, then that text will go away. It's just sort of there as a reminder. You've seen this before in forums, right? Okay, that's how you do that.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops