Possible Duplicate:
jQuery convert line breaks to br (nl2br equivalent)
目前,我 for each evt.which == 13
加<BR>
.JavaScript有nl2br()
,所以我可以go 掉这个evt.which == 13
吗?
How different is this from 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());
}
});