+ 3
Next to "submit" inside this event listener you have 1-100 Your code: ageForm.addEventListener('submit'1-100, (event) => { // your event logic } I don't know what this 1-100 should mean in your code, probably typo, correct syntax is ageForm.addEventListener('submit', (event) => { // your event logic } Also when you fix this error, your code wont work if you are using android. You will get error: you can't select element... It is because sololearn load js code before html, so this element don't exist jet. and you can't select it. Solution for this is to wait for document to load, and you can use next code to solve this: onload = () => { // your js code } So wrap code inside onload function if you need to work with DOM
23rd Dec 2022, 5:28 PM
PanicS
PanicS - avatar