Semidiscretization of stochastic partial differential equations by a finite-element technique