How the data from the html separated by commas to convert to array?

0 like 0 dislike
61 views
there is such a line in HTML:
text,65665,text,text,65665,56854


need js to pull the contents of that line and write to an array:
var array = [text,65665,text,text,65665,56854];
asked by | 61 views

2 Answers

0 like 0 dislike
const el = document.querySelector('#content') var array = el.textContent.split(',')
answered by
0 like 0 dislike
document.getElementById('content').textContent.split(',');
answered by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 23, 2018 by timers
0 like 0 dislike
2 answers
asked Oct 25, 2018 by EvgMul
0 like 0 dislike
3 answers
24,509 questions
45,932 answers
0 comments
346 users