I\'ve got this:
var quoted_text = window.getSelection;
For example:
Accepting the Terms of Service
The Stack Exchange Netw
Use javascript .split() function to create an array with elements splitted by '\n'
and then manually iterate through that array and add '<' for each item. The following code may help :
var str="How\nare\nyou\ndoing\ntoday?";
var n = str.split("\n");
for(var x in n){
n[x]= '>'+n[x];
alert(n[x]);
}
Use split()
Fore example
str = "abc\ndef";
console.log(str.split("\n"));
will print out
["abc", "def"]