Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
16958 Tampilan

How to insert line break in placeholder in text area field?

 

Avatar
Buang

Hello ,

You get any solution because i am facing similar problem.

Jawaban Terbai

I am surprised no one came up with a working solution in the last 9 years.

You can simply add & # 1 0 ; (without spaces) to your placeholder text, browser will register it as line feed.

Avatar
Buang
Jawaban Terbai

Is it possible ?? ;) Have you tried \n \r ?

Avatar
Buang
Penulis

yes tried that didn't work.

Jawaban Terbai

Only by formatting with multiple spaces, e.g.:

1st line of placeholder starts here                                         2nd starts here            etc    

If the size of textarea is fixed, browsers will show such long texts as if they were on multiple lines.

You'll have to fine-tune the number of spaces to make placeholder text look as you like.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jul 16
4345
0
Jul 16
5207
1
Des 15
3771
1
Nov 15
5195
1
Jan 24
15764