We apply the least-squares finite element method with adaptive grid to nonlinear time-dependent PDEs with shocks. The least-squares finite element method is also used in applying the deformation method to generate the adaptive moving grids. The effectiveness of this method is demonstrated by solving a Burgers' equation with shocks. Computational results on uniform grids and adaptive grids are compared for the purpose of evaluation. The results show that the adaptive grids can capture the shock more sharply with significantly less computational time. For moving shock, the adaptive grid moves correctly with the shock. (c) 2005 Wiley Periodicals, Inc.