I have a troublesome situation: what I want is to reassign the value 'hi' to the x
variable, however what I'm currently trying isn't working:
<script>
function hello(){
let x = document.getElementById("post-title").innerHTML
x = 'hi'
}
</script>
However, if I do it this way, it works:
document.getElementById("post-title").innerHTML = 'hi'
Why does it not work when using a named variable?