私は現在、次のコードを持っています
$(document).ready(function () {
var html = $('#wrapper').html();
$('#wrapper').html(html.replace(/hello/gi, 'hello<sup>®</sup>'));
});
画像内にある場合、またはドキュメント名に関連付けられている場合に「hello」を置き換えないように、「not」機能を追加するにはどうすればよいですか?
たとえば、「こんにちは」をページのどこでも置き換えたいのですが、
<img src="path/hello.jpg"/>
また
<a href="path/documents/hello.pdf">test</a>