SOURCE

function getNum(str) 
{
var num = 0;
for (var i = 0; i < str.length; i++) 
{
var char = str.charAt(i);
if (char != " " && !isNaN(char)) 
{
num++;
}
}
return num;
}
document.write(getNum("w8dsz39f890")+"个数字");
console 命令行工具 X clear

                    
>
console