Attach selection page html to document at last possible moment