Hello World.
would replace:
Hrm it doesn't seem to work..
​
I've tried:
$(document).ready(function() {
$('[id^="rep_"]').html(function() {
$(this).replaceAll($(this).replace('rep_', ''));
});
});​
-and-
$(document).ready(function() {
$('[id^="rep_"]').each(function() {
$(this).replace('rep_', '').html($(this));
});
​});​
Neither seem to work, however, this does work, only manual:
var target = document.getElementById('rep_target').innerHTML;
document.getElementById('target').innerHTML = target;
Related, but this is only text.
https://stackoverflow.com/questions/4239444/jquery-replace-all-text-for-element-containing-string-in-idwhere does the replacement come from? do you want to transfer-replace (transfer an existing content to replace target)? or clone-replace (copy an existing content and replace target)?