js call function when inner html changed code example Example: change innerhtml document.getElementById("p1").innerHTML = "New text!";