There are three types of XSS attacks :
(i) Non-Persistent XSS attack – Here the data injected by the attacker is reflected in the response and has a link with the XSS vector
(ii) Persistent XSS attack – The most harmful type of attack, where the script executes automatically the moment a user opens the page
(iii) Document Object Model (DOM)-based XSS attack – An advanced type of XSS attack which happens when a web application writes data to the DOM without any sanitization