got*_*tqn 3 jquery text elements
我想获得所有元素的文本.我在这里使用此代码:
$('*').filter(function()
{
if(($(this).text().lenght>0)&&($(this).text().lenght<100))
{
return true;
}
else
{
return false;
}
}).each(function()
{
console.log($(this).text());
});
Run Code Online (Sandbox Code Playgroud)
我试图只显示短文,因为.text()有时会返回HTML代码,但它根本不起作用.