window.parent.document
works because it is referring to the document of the parent window, ie. the page that contains your iframe
.
$(this).closest('tr').document
... doesn't mean anything. It doesn't exist, and because it doesn't exist your jQuery object is empty and empty objects do a whole lot of nothing.
I'm afraid I don't understand what you're trying to do here, but perhaps window.top.document
might help you? Or perhaps window.parent.parent.document
.