Auto-link hashtags with jQuery and JavaScript

We had a need for a bit of JavaScript that would look for hashtags (like #this) in content and auto-link them to search results.

So I popped over to CodePen and scrawled out some messy jQuery to make that happen.

This morning I woke up and thoughtโ€ฆ โ€œit has been a little while since I wrote JavaScript without the need for a library of cruft like jQuery, I wonder what this same incredibly simple task would look like without it?โ€ So I scrawled out some messy JavaScript for it on CodePen too.

I think jQuery is a great library but I do believe that Iโ€™ve come to rely on it too much. Perhaps Iโ€™ll write more pure JavaScript for simple things to see if I get a little more mileage out of them. And to keep my JavaScript muscles firing.

Last updated: