javascript - How do I extract texts only without html markup? -


i trying extract texts without html markup using innertext.

//table html table structure  var cells = table.innertext.trim() 

the cells data following:

1st cell        2nd cell     3rd cell     4th cell     last cell 

how make every cell data array?

i have tried

cells = cells.split(' ');  

but doesn't work.

any here? lot!

just extract text each cell:

var arr=[],     rowcells,     myrows=table.rows; (var i=0; i<myrows.length; i++) {     rowcells=myrows[i].cells;     (var j=0; j<rowcells.length; j++) {         arr.push(rowcells[j].innertext.trim());     } } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -