Split all input handlers to separate subfunctions
Remove empty spaces
Remove duplicate addClass declaration
Remove unnecessary elementType variables
Use more descriptive variables
Remove 'required' data attribute