What happens when the page is loaded with the following code?
<div id="myDiv"></div>
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('myDiv').innerText = 'New text';
});
What happens when the page is loaded with the following code?
<div id="myDiv"></div>
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('myDiv').innerText = 'New text';
});