build dom from javascript