hi guys | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

hi guys

what should be the ' if' condition if I want to show error in the form validation like if there are space between the alphabets then show no space between letter else success if (email.value=="") { console.log(error) } what should be the condition to show the error no space between letters

20th Aug 2022, 4:09 AM
Mani Singh
Mani Singh - avatar
1 Respuesta
0
You can use includes() méthode : if(email.includes(" ")) { console.log(error) } Or use test() method with regex if you want to add more conditions
20th Aug 2022, 5:31 AM
Roland
Roland - avatar