In this article, the event‐triggered data‐driven consensus problem is studied for multi‐agent systems (MASs) with switching topologies under denial‐of‐service (DoS) attacks. Based on the model‐free adaptive control (MFAC) approach, the controller is only correlated with the input/output (I/O) data of agents instead of the specific system model. First, the pseudo partial derivative (PPD) is employed to dynamically linearize the system model. Second, to save network bandwidth, an event‐triggered scheme is introduced according to the I/O measurement and the output estimated error. Third, an attack compensation mechanism is adopted for the purpose of reducing the influence of DoS attacks. Then, a data‐driven controller is designed to make the agents approach the desired trajectory on the basis of the estimation value of PPD. Moreover, by utilizing the Lyapunov stability theory, the tracking error is demonstrated to be convergent and the reliability of the controller is investigated. Finally, an example is simulated to verify the effectiveness of the consensus tracking strategy.