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?
that will make the code jQuery_ish_ and slower for no concrete reason/benefit in such small snippet