Code for validating email javascript