Dynamically Add Class In Javascript Syntax Validator