$('body') targets the html element, while $(document) targets the entire html document. That means if you want to reference something in the element you'll want to get there from $(document) because that's a direct path.
For your purposes, based on what you've shown us, they should be equivalent.