I am trying to use javascript to dynamically change the header to my website and thus the header was not changing. My html, for simplicity, looks like
<div class="container">
<h1 id="name">Nic</h1&g
<p id="email"></p>
<hr>
</div>
<script src="js/something.js"></script>
My javascript lives in a file called something.js and looks like
$(document).ready(function() {
console.log('I got run');
$('#name').innerHTML = "YO";
$('#email').innerHTML = "why hello";
})
For some reason I see the log in the console but the html never changes. Why is the header not getting changed?
I did try looking at the stack overflow question Javascript: Does not change the div innerHTML and here Setting innerHTML: Why won't it update the DOM? and many others however none of them address my issue.