Rockstar Rockstar - 1 month ago 11
HTML Question

use placeholder attribute in textarea

Is placeholder not supported in

textarea
?

I am using this

<textarea cols=33 rows=12 placeholder="Write about yourself"> </textarea>


but the placeholder will not show. How can I use placeholder with
textarea




<textarea cols=33 rows=12 placeholder="Write about yourself"> </textarea>

<input type="submit" value="submit">




Abk Abk
Answer

Remove the space between the <textarea> </textarea>

The space between the text area is considered to be a content and will not allow the placeholder text to show.

Consider this

<textarea cols=33 rows=12 placeholder="Write about yourself">I am writing about myself</textarea>

<input type="submit" value="submit">
It will not display the placeholder text

See the difference

<textarea cols=33 rows=12 placeholder="Write about yourself"></textarea>

<input type="submit" value="submit">

Hope it helps.