Well I\'m simply playing around with a userscript of GreaseMonkey and here\'s just something simple I attempt to do;
function test() {
document.getElementById(\'
It is because you are assigning the result of the test
function instead of the function itself due to the parentheses ()
on the last line.
Remove them and it may work.
If not then:
Apparently that is by design. [Chrome - v57
]
Use document.addEventListener("DOMContentLoaded",
instead.
See: Page lifecycle : DOMContentLoaded