Ctrl+の使い方を教えてくださいEnter↵</kbd> as Enter↵</kbd> using Jquery. I need it for chatting application.
divを使った作成方法"<div id="divChatMessage" contenteditable="true"></div>')"
私のコードとして次のショー
$('divChatMessage').bind('keyup',function(ev){
if(ev.keyCode == 13 && ev.ctrlKey){
if(document.selection && document.selection.createRange){
this.focus();
var range = document.selection.createRange();
range.text = "\r\n";
range.collapse(false);
range.select();
}else if(window.getSelection){
//i don't know what to do?
}
}
})