I'm trying to replace text on a site using this code:
<script type="text/javascript">
$(document).ready(function () {
$(function() {
$(document.body).find('*').each(function() {
var tmp = $(this).children().remove();
var text = $(this).text();
text = text.replace(/Vorname/g, "Firstname");
$(this).text(text);
$(this).append(tmp);
});
});
});
</script>
HTML (snippet) is like this (generated by SharePoint):
<td style="padding:4px;">
<div>
<label for="ctl00_IWS_WH_CPH_Content_ContactUsControl1_firstName">
<span><font color='red'>*</font> Vorname (erforderlich):</span>
</label>
</div>
The above jQuery code is not being executed... Reference to jQuery has been placed in the master page.
Any clue why this is not working?
Regards, Thomas