$("a[rev="title"]").each(function () { var u = $.trim($(this).html()); $(this).html(SetSub(u, 10))}); SetSub相当于substr