The Remaining Useful Life (RUL) of lithium-ion batteries is an essential indicator in battery management systems. Accurately predicting the RUL of lithium-ion batteries is beneficial for designing a reliable battery system, ensuring the safety and reliability of the operation of the battery system. This paper proposes a method based on Fast Ensemble Empirical Mode Decomposition (FEEMD)-Long Short-Term Memory (LSTM)-Temporal Attention Mechanism (TAM)-Online Kernel Extreme Learning Machine (OKELM) for predicting the RUL of lithium-ion batteries for nonlinear and non-stationary capacity sequences. First, the FEEMD algorithm decouples the battery capacity data to separate the overall trend and oscillation signals in the capacity data; subsequently, LSTM-TAM and OKELM were used to predict the overall trend and oscillation signals, respectively. A series of comparative experiments were conducted on the lithium-ion battery datasets of the National Aeronautics and Space Administration (NASA) and the Center for Advanced Life Cycle Engineering (CALCE) at the University of Maryland to validate the accuracy and effectiveness of this method. The experiment shows that this method has stable RUL prediction performance for lithium-ion batteries, with an absolute error of no more than one cycle in the NASA dataset and no more than two cycles in the CALCE dataset.