About this question
Is it possible for me to steal the XSS cookies without getting redirected to another page?
A blog had the following paragraph related to the XSS i.e Cross-site scripting, often abbreviated as XSS, is a type of attack in which malicious scripts are injected into websites and web applications for the purpose of running on the end user's device. During this process, unsanitized or unvalidated inputs (user-entered data) are used to change outputs.