FCC Challenge 28: Add Placeholder Text to a Text Field
March 11, 2016
In Free Code Camp Challenge 28 we can add a placeholder text to the text input field.
Your placeholder text is what appears in your text input before your user has input anything.
You can create placeholder text like so:
[html]
[/html]
Set the placeholder value of your text input to “cat photo URL”.
The original code is below:
[html]
CatPhotoApp
Click here for cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats
The updated code with placeholder text for the text input field is below:
[html highlight=”46″]
CatPhotoApp
Click here for cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats