I try do something like terminal in JS, and I need create word 'current source, current location' (for example:admin@ubuntuTLS~$: ~/Desktop) at the beggining, that can not remove and, so that caret cannot be moved back on front of it. I was trying something do with window.range() on 'input' event ( for not move caret to back it):
https://www.google.com/amp/s/www.geeksforgeeks.org/how-to-set-cursor-position-in-content-editable-element-using-javascript/amp/
But it doesn't work. I don't know What Can I do.
this is that 'word (location) '
In a terminal, this defaults to the user name of the computer. Open console in chrome and test javascript there. Here is simply tutorial
1.4m articles
1.4m replys
5 comments
57.0k users