JavaScript DOM generator