"You're comparing apples to oranges."
Exactly, that’s the point!
They are not the same thing. Yet, many developers do see them as similar. They are two different program models entirely as you’ve pointed out, and the problem is when people use JavaScript to make HTML that doesn’t work with JavaScript, they are locking people out of data for no good reason.
HTML stores the information. JavaScript is a programming language that evolves, changes and breaks old code (ES5). One day we may be scripting web sites in a language other than JavaScipt. Ruby, or Python. The scripting layer is supposed to be swappable (that was the design of the DOM). So if people lock data into the requirement of JavaScript, they are shooting themselves in the feet.