build DOM completely from javascript DOM APIs