javascript - Remove invalid characters from email -
i want users mistakenly entering invalid characters in email input (pre server-side validation/cleanup) note: not validating emails in frontend, cleaning up // coffeescript $(element).find('input[type="email"]').on 'change keyup', (event) -> = $(this) v = i.val() i.val(v.replace( [what goes here?] , '')) i want remove space , illegal characters. what's regex pattern? something like. saying, strip things not want. honest, not know acceptable email chars. .replace(/[^a-za-z0-9_-@.]/g,'')