There are multiple issue,
-
Issue with JSFiddle: JsFiddle declares are variable in local scope and hence cannot find the method. It should work on your page/website.
-
There is a typo: getEementById missing
l
. - Your object is in document so just write
document.getElementById()
This works. https://jsfiddle.net/hc8g901k/5/