0
我所面臨的問題與我的SharePoint 2013的調查替換一個文本到另一個:jQuery的/的SharePoint 2013的文本替換問題
我想換成這樣的文字:"Specify your own value:"
與"marshmellows"
。
不幸的是,這段代碼不起作用。我是SP和jquery的noob。 我立足這篇文章: jQuery find and replace string
這裏是我的代碼:
$(document.body).find('*').each(function() {
var tmp = $(this).children().remove();
var text = $(this).text();
text = text.replace("Specify your own value:", "marshmellows");
$(this).text(text);
$(this).append(tmp);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<div>
<p>
<h1>
<a>Specify your own value:</a>
</h1>
</p>
</div>