Showing posts with label html to text js parser. Show all posts
Showing posts with label html to text js parser. Show all posts

Wednesday, February 15, 2012

html2text

function html2text(){
var o={};
o.txt='';
o.t = document.getElementsByTagName('*');
for(o.i in o.t){
if(o.t[o.i].childElementCount > 0){
console.log(o.t[o.i].childElementCount, o.t[o.i].tagName);
}else{
console.log(o.t[o.i].innerHTML);
}
}
}