shakira
shakira

Reputation: 125

Textarea Placeholder is not working

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>

Upvotes: 3

Views: 1340

Answers (1)

Abdulla Nilam
Abdulla Nilam

Reputation: 38672

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.

Upvotes: 2

Related Questions