how to change content inside div in javascript code example Example: javascript update text in div fieldNameElement.innerHTML = "My new text!";