+ 2

Why do the '.lenght' doesn't work ?

https://code.sololearn.com/WjnV1qnET52c/?ref=app I did that but when i click on the submit button it displays 'undefined'

20th Mar 2018, 4:56 PM
Valkyrion
Valkyrion - avatar
2 Respostas
+ 4
FIRST ERROR: it is "length" not "lenght" SECOND ERROR: when you want to compare with ' ' you should use === not == like that: if($('#username').val() === '') { BTW it is nice code :D
20th Mar 2018, 6:20 PM
Baraa AB
Baraa AB - avatar
+ 2
Is written "length".
20th Mar 2018, 5:11 PM
Federico Mariotta
Federico Mariotta - avatar