JavaScript
Article
By Sam Deering

jquery get parent element with specific class

By Sam Deering

Quick jQuery snippet to get parent elements with specific class.

--ADVERTISEMENT--

var container = $(this).parents('.item');
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account