我目前正在一个由主机提供的网站上启动javascript,在该网站上我只能更改网站的指定部分。事实上,我应该能够通过 javasript 更改所有内容,因为我能够在标题中包含 javascript。到目前为止,我已经成功地做到了这一点,但我陷入了无法找到进一步答案的地步,所以这里是事实:
不可更改的HTML代码如下所示:
<div>
<intput .... />
<intput .... />
<intput .... />
<intput .... />
<div> ... some unimportant informations ... </div>
<hr />
<strong> SOME TEXT: </strong> additional text with important things to change
<hr />
</div>
问题 :
如何选择我要更改的文本。
我尝试过但没有成功:
$("*").each(function() {
$("this:contains('important things to change')").replace('important things to change', 'new text here');
}
实现所需的正确方法是什么。