I have an h1 with id of toptitle that is dynamically created, and I am not able to change the HTML. It will have a different title depends on a pag
h1
toptitle
Something like this should do the trick:
$(document).ready(function() { $('#toptitle').text(function(i, oldText) { return oldText === 'Profil' ? 'New word' : oldText; }); });
This only replaces the content when it is Profil. See text in the jQuery API.
Profil