Code for validating email in javascript