From reading this post I have found that there are some pseudo classes for 'valid' and 'invalid' input values introduced to HTML5.
Is there a way I can mark an input field as invalid/valid from javascript? Or alternatively, can I override the validation method used?