What is an XSS attack and how to prevent it?

XSS (Cross-Site Scripting), cross-site scripting attack, because the abbreviation overlaps with CSS, it can only be called XSS. Cross-site scripting attack refers to an attack carried out by running illegal HTML tags or JavaScript in the browsers of registered users of web sites with security vulnerabilities