1st Floor
textarea.value.replace(/n/g, "
");
2nd Floor
s=textarea.value.replace(/rn/g, "
") ;
3rd Floor
Change immediately when pressed
V ID="a" contentEditable="true" style='border:1 solid black'>
In fact, there were many before People have discussed that there are too many code methods that are too scary. If you don’t use them, you don’t have time to study them. Now I’ve tried it for you. In fact, the solution is very simple:)
About Microsoft HTML Edit Control Click back Solution where the car will insert
instead of
Unscripted edit control
4th Floor
Change immediately when pressed
V ID="a" contentEditable="true" style='border:1 solid black'>
In fact, many people have discussed it before. It is too scary to have too many code methods. If you don’t use it, you don’t have time to research it. Now I’ll try it for you. In fact, the solution is very simple:)
Regarding the Microsoft HTML editing control, clicking Enter will insert
instead of Solution
Unscripted editing control
5th Floor
Replace immediately when pressed
V ID= "a" contentEditable="true" style='border:1 solid black'>
In fact, many people have discussed it before. It is too scary to have too many methods in the code. If you don't use it yourself, you won't have time to study it. Now I will help you. I tried it, and the solution is actually very simple:)
About the solution that Microsoft HTML editing control inserts instead of
when clicking Enter
Unscripted editing controls
<script> <BR> function a.onkeypress(){ <BR> if(event.keyCode==13){ <BR> var txtobj=document.selection.createRange() <BR> txtobj.text==""?txtobj.text="\n":(document.selection.clear())&(txtobj.text="\n") //三目复合表达式,解决有被选文字时回车的光标定位问题 <BR> document.selection.createRange().select() <BR> return false <BR> }} <BR> </script> <script> <BR> function a.onkeypress(){ <BR> if(event.keyCode==13){ <BR> var txtobj=document.selection.createRange() <BR> txtobj.text==""?txtobj.text="\n":(document.selection.clear())&(txtobj.text="\n") //三目复合表达式,解决有被选文字时回车的光标定位问题 <BR> document.selection.createRange().select() <BR> return false <BR> }} <BR> </script> <script> <BR> function a.onkeypress(){ <BR> if(event.keyCode==13){ <BR> var txtobj=document.selection.createRange() <BR> txtobj.text==""?txtobj.text="\n":(document.selection.clear())&(txtobj.text="\n") //三目复合表达式,解决有被选文字时回车的光标定位问题 <BR> document.selection.createRange().select() <BR> return false <BR> }} <BR> </script>