jQuery obtiene el texto de todos los elementos en una página
Quiero obtener el texto de todos los elementos. Estoy usando este código aquí:
$('*').filter(function()
{
if(($(this).text().lenght>0)&&($(this).text().lenght<100))
{
return true;
}
else
{
return false;
}
}).each(function()
{
console.log($(this).text());
});
He intentado mostrar solo texto breve porque .text () en algún momento devuelve código html pero no funciona en absoluto.