Remove trailing whitespace
Use plain javascript, remove jQuery