Be Brav3

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.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
[/html]

The updated code with placeholder text for the text input field is below:

[html highlight=”46″]

CatPhotoApp

Click here for cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
[/html]