Nice to see you all thinking about a JS version of validating empty inputs. Your HTML already has the required field so this piece of code may never be executed.
Also, if you would like to do the alert and then do nothing, you can just write return; instead of return false;
I am actually also able to add empty todos by spamming the space bar, can you find a way to validate this in JS? 😈
https://github.com/fac-14/teamcoolerweek-2/blob/4b588fb49da82ef7d3bdaea8458d8c7c54c80362/dom.js#L62-L66
Nice to see you all thinking about a JS version of validating empty inputs. Your HTML already has the required field so this piece of code may never be executed.
Also, if you would like to do the alert and then do nothing, you can just write
return;
instead ofreturn false;
I am actually also able to add empty todos by spamming the space bar, can you find a way to validate this in JS? 😈