I'm creating variables through PHP and sending them to Javascript by echo'ing them, then using document.getElementById in JS to grab their values.
The problem with this I have realized is that the elements I am writing with their their php variables are being shown when anyone views the source. It's not behaving like JS where I can write HTML and nothing gets shown on the source (using document.write for example).
How can I send variables from PHP to JS without affecting the viewable source like JS does?