我希望更改替换字符串中的书写光标(键入时显示/隐藏光标)位置。
这是我的字符串:
if(str.indexOf('<html>') != -1){
str = str.replace(/\<html\>([a-z|A-Z|0-9| ])/g, "<html>\n \n</html>");
}
这意味着当我输入<html>
结果时:
<html>
</html>|
^
The typing cursor
现在想要的结果:
<html>
|
</html>
如何在替换字符串中自定义/放置键入光标?