Skip to content
Advertisement

Javascript innerhtml not working on div

JavaScript

Why is document.getElementById("passage").innerHTML = "Paragraph changed!" not working for me? I just end up with a blank screen, not even the original “hello”.

Advertisement

Answer

Your script is called before the element is loaded, try calling the script after loading element

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement