DEV Community

Discussion on: Matching elements with selectors in JS

Collapse
 
bennadel profile image
Ben Nadel

Oh, very cool! I knew about .matches(), but I didn't know that we had .closest() as well. This is perfect for any kind of event-delegation. About time!