ある要素内の文字列を置換する
var el = $('#id');
http://www.catswhocode.com/blog/8-awesome-jquery-tips-and-tricks
el.html(el.html().replace(/word/ig, ""));
この例酷すぎるでしょ。
置換対象の文字列がHTMLのタグ名に含まれるものならHTMLの構造が壊れるし、
属性の値と一致してた場合等も壊滅的におかしくなる。
やるならこうでしょ。textnodeのみ対象にすべき。
$('#id').find('*').andSelf() .contents().not('[nodeType=1]') .each(function(){ this.nodeValue = this.nodeValue.replace(/word/ig,''); });