In this paper we study the set of ℊ-valued functions which can be approximated by ℊ-valued continuous functions in the norm L(I,w), where I is a compact interval, ℊ is a separable real Hilbert space and w is a certain ℊ-valued weakly measurable weight. Thus, we obtain a new extension of the celebrated Weierstrass approximation theorem.