The Euler-Maruyama (EM) approximation to a class of stochastic functional differential equations was studied. First, a numerical approximation with the EM method with random variable stepsizes was defined, then two characteristics of the random variable stepsizes were got: the summation of finite stepsizes is a stopping time and the summation of countably infinite stepsizes diverges. Finally, with the theory of non-negative semi-martingale convergence in discrete time, it was proved that the numerical approximation converges to zero almost surely if the coefficients satisfy the local Lipschitz condition and the monotonic condition. The results generalize the corresponding results of MAO Xuerong in a previous literature, where the EM approximation to a class of stochastic differential equations was studied and the numerical solution was proved to converge to zero almost surely.