3

I have written the below textarea code and the placeholder is not working. I can't see the placeholder on the textarea box.

<textarea rows="4" cols="50" placeholder="Current Address">
</textarea>
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
shakira
  • 125
  • 1
  • 1
  • 8

1 Answers1

2

don't keep gap between start and end tag <textarea></textarea>

use this:

<textarea rows="4" cols="50" placeholder="Current Address"></textarea>

W3School Example

The reason that this works is because the newline character in between the textarea tags is considered content, so it is placed inside the box instead of the placeholder.

Caleb Eby
  • 356
  • 3
  • 14
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85