重複の可能性:
jQueryは改行をbrに変換します(nl2brに相当)
現在<BR>
、各に追加しますevt.which == 13
。JavaScript 用の があるnl2br()
ので、これを廃止できますevt.which == 13
か?
これはphp.jsとどう違うのですか
$('#TextArea').keypress(function(evt) {
if (evt.which == 13) {
var range = $('#TextArea').getSelection();
var image_selection = range.text;
$('#TextArea').replaceSelection('<BR>');
$('#TextArea1').html($('#TextArea').val());
}
});