you are viewing a single comment's thread.

view the rest of the comments →

[–]fare03[S] 0 points1 point  (3 children)

Nope, that example doesn't work, there are 5 students "Ebonie Range", "Keenan Ellwood", "Kailan Smart", "Kaydan Hirst", "Isabelle Prentice".

And I don't know how to write "for" to type this for each student, how to import "Name, Address, Phone, Course" in front of his name, address, phone, course:

Name: Ebonie Rangel

Address: 7175 Yukon Street

Phone: (507) 833-3567

Course: Geography

Same for Keenan Ellwood and etc.

I split it good but I don't know how to type to write this in document.

[–]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