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