A DOM-based XSS occurs when an injected script modifies the webpage’s DOM to achieve the intended effect, like changing the input fields. This type can either be a stored or reflected XSS.