How to remove XSS and protect your website

Cross-site scripting (XSS) is a security bug that can affect websites. If present in your website, this bug can allow an attacker to add their own malicious JavaScript code onto the HTML pages displayed to your users. It refers to client-side code injection attack wherein an attacker can execute malicious scripts  into a legitimate website or web application. XSS  is one