私のhtmlドキュメントには、このコードがあります
var client = new XMLHttpRequest();
client.open('GET', '(URL)example.txt');
client.onreadystatechange = function() {
var theblog = client.responseText;
$("#bloglocation").html(theblog);
}
client.send();
});
そのロードされたhtmlで私は持っています
<p class="example">example</p>
ファイルの後半で、jquery を使用して、クラス例のすべての要素の色を変更します。
$('.example).css({"background-color" : "yellow"});
jquery は、読み込まれた html にないそのクラスを持つすべての要素に対して機能します。ロードされたhtmlのクラスで機能させるにはどうすればよいですか。