The carrier-envelope phase (CEP) of femtosecond pulses from a mode-locked Ti:sapphire laser is stabilized using a novel method operating in the time domain. This is a direct and relatively simple method for stabilizing the CEP of femtosecond laser pulses, compared to the conventional method based on phase-locked loop. Using this method, we have directly locked the pulse-to-pulse CEP slip to zero with an in-loop phase jitter of 0.05 rad. Out-of-loop measurement has revealed a comparable phase jitter of 0.1 rad, verifying a good performance of this locking technique. The capability of electrical CEP modulation is also demonstrated. (C) 2005 Optical Society of America.