brタグがDIVで機能していません。Update Content:textarea
フィールドからメッセージを受け取ります。メッセージには、「Rama」の次の行「Lingam」のような2行があります。でも結果は「
ラマリンガム」$("#editQuotesRowLabel_Q_013").text(replaceContent);
DIVで改行する方法は?
これが私のコードです:
function updateQuotes(){
var weg_quotes = $("#weg_quotes_Q_013").val();
replaceContent = weg_quotes.replace("\n", "<br>", "g");
$("#editQuotesRowLabel_Q_013").text(replaceContent);
}
Update Content: <textarea placeholder="Update your content..." id="weg_quotes_Q_013" name="weg_quotes" cols="80" rows="3" class="appQuotesTextarea" maxlength="200" required=""></textarea>
<button onclick="updateQuotes()" id="Q_013" name="update-btn" class="appQuotesBtn">Update</button>
<div id="editQuotesRowLabel_Q_013" class="appQuotesLabel">
This is content div.
</div>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加