JSLint gives errors with simple function, running on brackets with JSLint.
Javascript:
function soundSorry() {
getElementById("player").play();
}
Error codes:
2 Missing 'use strict' statement. getElementById("player").play();
2 'getElementById' was used before it was defined. getElementById("player").play();
Any ideas?
You missed
documentprefix. AsgetElementByIdis defined ondocumentobject you've to call it usingdocumentobject as follow:Docs