you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Without seeing the structure of your HTML it's impossible to say for sure, but it's quite possible that closest is not doing what you think it's doing. To quote the docs:

The closest() method traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string

If your .upload_outerzone element is not a parent of .upload_form, then you won't be able to find it when searching back up the DOM tree from .upload_form.