>>However, to do that, you have to have the entire JQuery library loaded as well.
But you didn't have to write that code or debug it.
But you didn't have to write that code or debug it.
That is, if you don't need to support IE (And I feel like we're finally in the phase where it slowly, but steadily dies off). Otherwise you can ponyfill it.