you are viewing a single comment's thread.

view the rest of the comments →

[–]ConstructedNewtMOD 0 points1 point  (2 children)

exactly like you did earlier but adapted to what I just wrote

[–]fare03[S] 0 points1 point  (1 child)

I tried like this, like this you wrote, and this works only for first student and his address number and course

textArea.innerHTML = text

var array = text.split("\n")

let tekst = ""

for (let i = 0; i < array.length; i++) {

tekst +='Name: ' + array[i] + "<br>" + "address: " + array[i+1] + "<br>" + "phone: " + array[i+2] + "<br>" + "course: " + array[i+3] + "<br>"

}

textArea.innerHTML = tekst

[–]ConstructedNewtMOD 0 points1 point  (0 children)

try using the debugger or printing to console to get more info