2016-05-05 5 views
2

私は入力フィールドを作成しています。指示がクリックされると自動的に非表示になります。私はそれをすることができましたが、長い文章が正しく表示されていないことがわかりました。私はCSSでラップコードを試みたが運がない。ここで入力フィールドのテキストをjQueryでラップする

はコードです:

.replybox{} 
 
.reply-control{ 
 
border:1px solid #ccc; 
 
background: transparent; 
 
font-size:20px; 
 
width:100%; 
 
height:100px; 
 
color:#8d8d8d;}
<input class="reply-control" name="replybox" onblur="if (this.value == &quot;&quot;) {this.value = &quot;How to wrap this text? It is hiding the overflown text. I am not finding any way. Please help&quot;;}" onfocus="if (this.value == &quot;How to wrap this text? It is hiding the overflown text. I am not finding any way. Please help&quot;) {this.value = &quot;&quot;;}" value="How to wrap this text? It is hiding the overflown text. I am not finding any way. Please help" type="text"/>

JSFiddlehere

+1

テキストエリアを使用できますか? – Chris

+4

プレースホルダテキストを作成しようとしていますか?ネイティブのプレースホルダタグを使用して簡単に行うことができます。 –

+0

しかし、テキストエリアではjQueryコードは機能しません...実際のコードを表示します – Nilot

答えて

1
<textarea type="text" placeholder="Update details of your present skin condition (e.g. normal, dry, flaky, etc). Optionally, add details of any past skin conditions, medication or skin treatments/surgeries undergone. You may also upload images/reports, so that doctors understand your condition better." value=""></textarea> 
+0

あなたができるプレースホルダを使用すると、テキストは自動的にラップされ、css/jqueryプロパティはプレースホルダをサポートしません。 –

関連する問題