Ok grazie tante trovato.
mancava document. davanti a getElementById

GRAZIE!!!!