使用jquery从段落中删除某些单词

我有一个这样的网页:
<p class="author">By ... on Jan 23,2012</p>
<p class="content">(some content)</p>

<p class="author">By ... on Jan 23,2012</p>
<p class="content">(some content)</p>

...

我想使用jquery从p.author中删除单词“By”和“on”,结果将是:

<p class="author">... Jan 23,2012</p>
<p class="content">(some content)</p>
...

谢谢!

解决方法

$(".author").each( function(){
    var text = this.firstChild.nodeValue;
    this.firstChild.nodeValue = text.replace( /(^By|\bon\b)/g,"" );
});

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...