A textarea can contain only Character Data. i.e. a String
The character data can include newlines / carriage returns i.e. \r, \n, \r\n
dependening on the OS
Browsers do not display these characters as lines unless they are inside pre tags or converted to br tags (well, in some cases p tags - ugh)
Th only way I can think of to determine which “line” a word occurs in is to split the string into pieces and look for the word in each or find the word and then find the first “line character” that precedes it.