Explain XSS attack and how to prevent it?

Technical