Client side: I discovered jquery closest() :D