Hello,
Thank you for your reply.
I am new to JavaScript, have gone through the courses on MDN, but I am blocking. So, I go to other resources to try to move forward. I bought a book, but the JavaScript is on the same file as the HTML. So to respect the best practices recommended by MDN, I transfer the JavaScript to a separate file.
In this case, the .length property does not work when the function is in a separate file.
The link to the Javascript file is indeed in the tag itself in the tag.
My problem is that an error message appears :
"script.js: 12 Uncaught TypeError: Cannot read property ‘length’ of undefined at HTMLInputElement.nonVide ", while it works when the JavaScript is in the HTML.
If I understand correctly, something is missing to make the connection, but I don’t know what.
you very welcome in both of the links you provide you put the js code inside the script tag you need to use the src of the script tag
go to code pen and put your html file in the html panel and the js file code into the js panel so i can read both of them in one page and see if you link them as it should be or not
open the html file on your computer then right click on any empty space then inspect then go to the console tab you will see it complain that button is null