I have faced a problem with replacing one text to another on my SharePoint 2013 survey:
I would like to replace this text: "Specify your own value:"
with "marshmellows"
.
Unfortunately this code doesn't work. I am a noob with SP and jquery. I was basing on this article: jQuery find and replace string
Here is my code:
$(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>