Update main.js

This is a size improvement over repeated document.querySelector calls, aiming to better shrink once passed through minifiers.
The script is small already but being a base reference, why not smaller, if it's possible keeping it clean?
why do you want cut out browsers that will work without problems ? there's no need to be stubborn here, just pragmatic, IMO