You don't need to select the 'closing' tag, just select the body and append what you want:
$('body').append('<h1>foobar</h1>');
update
As @meagar mentioned correctly, with jQuery you don't select a 'closing' tag, but the whole 'element', e.g. the body, or a 'paragraph' (p) as a whole
Trying to make it more clear, this code:
<body>
<p>my paragraph</p>
<script>
$(body).append('<p>new paragraph</p>');
</script>
</body>
Will produce this result:
<body>
<p>my paragraph</p>
<script>
$(body).append('<p>new paragraph</p>');
</script>
<p>new paragraph</p>
</body>
The new paragraph is appended at the end of the body