How do I retrieve a php variable in JS? I tried using "document.getElementById()" but it always returns NULL. There must be something I don't understand from the instructions. I tried several variations.

I.e. if a php variable is named $test
what does the retrieval to JS look like?