This question is quite different with How do I use the Enter key as an event handler (javascript)? or Prevent form submission on Enter key press
I just want to use a JavaScript function to replace Enter Key Event.
For example, now I am typing this string into a textarea
"Hello world Hello world Hello world"
As you can see there are three "Hello world" in this string.
If I want to make this string to this effect
"Hello world
Hello world
Hello world"
I should press the Enter key after every "Hello world".
Now this question is how to use JavaScript to replace the Enter Key Event? It means the user doesn't need to press the Enter key and the scripts would do it automatically.
And also I hope that the scripts would cross different browsers.