use closest() instead of parents()

see http://api.jquery.com/closest/