`$this.parent()` can be fragile. `$this.closest('...')` may be better. YMMV.