JS Code pen not working

Using getElementsByClassName is a very old technique that has some issues with it.
I recommend that you use querySelector instead, so that the array index isn’t required either.

var output = document.querySelector(".output");
3 Likes