Design comparison
SolutionDesign
Community feedback
- @sanju321GHPosted about 1 year ago
yo hi, i think there is a mistake in you code i mean the code is just checking for "@" and "g" but not "mail.com" when i typed "wd@g" it worked. to avoid this you could do this
JS-
let gmailholder; document.getelementbyID("btn").onclick = function(){ gmailholder = document.getelementbyID("inputfield").value; let gmail = gmailholder; //i dont know y but if i dont write this code it gives me error let gmailchecker = slice(gmail.indexof("@")); if(gmailchecker == "@gmail.com"){ (give them the result) } else{ (give them the error) }
}
hope you dont make the mistake you have made now in the future.π also keep it upπ
Marked as helpful1@yulich81Posted about 1 year ago@sanju321GH thank you very much for the feedback. I will double check the validation and js code.
upd. Corrected redex validation code.
0 - @enzo-mirPosted about 1 year ago
You use "gmail" only for this line of code :
- let gmailchecker = slice(gmail.indexof("@")); ^ Maybe just get "gmailholder"'s slice as the declaration of "gmail" is "gmailholder" :
- let gmailchecker = slice(gmailholder.indexof("@"));
Else if good job !!
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord