For a class of nonlinear systems with varying trail lengths, we study the PD-type iterative learning control problem of desired trajectory tracking with input time delay. We describe the varying trail length by the probability of the system output at the time point and correct the lack of tracking error information caused by it using the zero-compensation mechanism to facilitate the update of complete time axis information of different iteration control laws. Then, we design a PD-type iterative learning control algorithm based on the given advanced method to eliminate the influence of the input time delay on the control law update. We prove that the proposed algorithm can ensure that the tracking error converges strictly when the initial states are the same and expects to converge when the initial states are different using the mathematical expectation and norm analysis. Finally, the simulation results of the output tracking of a single-link system driven by a DC motor validate the effectiveness of the proposed algorithm.