I've been mucking around with Javascript for the first time and have found that while you can easily do something like
<p id="demo"> Hello </p>
<script> document.getElementById("demo").innerHTML = "<strong>Hello</strong>"; </script>
and get "Hello". You can't do something like
<p> Hello my name is <strong id="demo">Sam</strong></p>
<script> document.getElementById("demo").innerHTML = "Sam </strong> and <strong> Susan"; </script>
and get "Hello my name is Sam and Susan".
I've had a look at places like w3schools to try to understand this. My best guess is that for whatever reasons .innerHTML can't actually change the "outer" of the element that it's altering. I'd love it if somebody could give me a slightly more clear explanation of this behaviour. I don't think it's something I want to use I'd just like to understand it a little better.