jQuery selector helper and visual reminder

Written from Girona, Catalonia

I’ve mixed up a handful of jQuery selectors — like .closest(), .next(), .find(), siblings(), first() — enough times to motivate me put this CodePen together to help me remember. The last, and very recent, time rereading jQuery API docs for something that should be ingrained in my brain was enough.

I decided to show the result of selectors visually, on click, to help my brain make the connections and distinctions.

See the Pen Help to remember jQuery selectors I regularly misunderstand by paddyohanlon (@paddyohanlon) on CodePen

Enjoy Reading?
Get New Posts by Email

Get posts direct to your inbox as soon as I publish. Unsubscribe anytime. Don't worry, I hate spam as much as you.

Other Writing