You can use the .load() method
The .load() method allows you to specify a portion of a deleted document to insert. This is available using special syntax in the url parameter. If one or more whitespace characters are included in the string, then the first word, after the first whitespace, will assume the jQuery selector, which determines which part will be inserted.
If you need to insert the resulting HTML code into the page:
$('селектор, куда нужно вставить').load('sortmonth #container')
If you need to get exactly the HTML code:
var $temp = $('<div>').load('sortmonth #container', function () { console.log($temp.html()) // $temp.html() HTML-код контейнера #container })