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
document
prefix. AsgetElementById
is defined ondocument
object you've to call it usingdocument
object as follow:Docs