Splitting HTML from Javascript