I have a textarea , when I press any key or by copy-pasting the content.
I wanted to get the array of content as per rows.
.text {
overflow: hidden;
font-size: 5vh;
text-align: center;
line-height: 1.5;
}
<textarea class="text" autofocus></textarea>
I have simply added the text and I am Not clicking enterKey while going to next line. It automatically goes to next line as Overflow: hidden is added.
Now I must get the array like this:-
["Sarah and Ira drove to "],
["the store Samantha, "],
["Elizabeth, and Joan are "],
["on the committees"].
By every update in content, the array should be updated too.
I have tried with split("\n") approach, it didn't worked. while trying Split approach, I am getting full value.
"Sarah and Ira drove to the store Samantha, Elizabeth, and Joan are on the committees"
I wanted the array of content as per rows with clicking enterKey/ without clicking enterKey. By both ways it should work.
Anyone have any ideas?
Note:- My main motive is actually get the array of content as per rows and put the same content(array of rows) in textbox object of fabricjs.
Explaining:- I have a Textarea of HTML and a textbox object in canvas of fabricjs .
I have added some content in textarea of HTML.
Now I have to save(put/show) that content(Same content written in Textarea of HTML with same rows and text) into textbox object of fabricjs.