Answer:
A. Input validation
Step-by-step explanation:
Based on the information provided within the question it can be said that the best way to protect against XSS would be Input Validation. This is a programming technique of preventing data that is improperly formed from entering the system and maybe causing problems with that system, and is done by coding defensively and escaping metacharacters, thus preventing all script-like input.