Updated JavaScript syntax to jQuery

I’ve now updated most of the JavaScript to jQuery syntax for cleaner,
more consistent code.