问问题
128 次
1 回答
0
$(function() {
var text, charsLength=0,wordsCount=0;
$('#strongdiv strong').each(function() {
text = $.trim($(this).text());
charsLength += text.length;
wordsCount += text.split(/\s+/).length;
});
$("#output").append("words"+wordsCount+"<br/>chars: "+charsLength);
});
于 2013-05-02T21:38:29.670 回答