brタグがDIVで機能していません。 更新内容:textarea
フィールドからメッセージが届きます。 メッセージには、 "Rama"の次の行 "Lingam"のような2行があります。 結果は "Rama
Lingam" by $("#editQuotesRowLabel_Q_013").text(replaceContent);
brタグが機能していないときに、JREERYテキスト関数を使用してテキストエリアからDIVにコンテンツを置き換えます。
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>
これはうまく働いています。ありがとうございます! –