can you tell me as a beginner how much JavaScript i should learn? for example i do know about addEventListener, but here the syntax is a bit different Hope you understood my question
As a beginner, you should focus on learning the basics of JavaScript syntax, including variables, data types, control structures, functions, and objects. Once you have a solid understanding of these fundamentals, you can start learning more advanced topics like DOM manipulation, AJAX, and frameworks like React or Angular. Don't be afraid to experiment and practice coding on your own. Building small projects and tinkering with code is one of the best ways to learn and improve your skills as a JavaScript developer.
Hi, it is difficult to say without seeing your code, but one of the ways to implement regex check would be: const form = document.querySelector("#form"); const input = document.querySelector("#phone"); const output = document.querySelector("#output"); const re = /^(?:\d{3}|\(\d{3}\))([-/.])\d{3}\1\d{4}$/; function testInfo(phoneInput) { const ok = re.exec(phoneInput.value); output.textContent = ok ? `Thanks, your phone number is ${ok[0]}` : `${phoneInput.value} isn't a phone number with area code!`; } form.addEventListener("submit", (event) => { event.preventDefault(); testInfo(input); });
I highly suggest you to google the error and try to find the solution to this error. Also you could try (if you are using chrome) go into the Network tab of the Chrome Developer Console and make sure that the connection is on No throttling and not Offline.
how to call the function with each of these variables as an argument emailaddress variable and emailconfirm variables Do you know how to make two of the same emails need to match and is that client side validation or server side? Inquiry of js on html form
First of all you need to create two more input fields, lets say with id's "email" and the other - "emailConfirm". Then you need to add two constants in script.js file: const email= document.getElementById("email"); const emailConfirm= document.getElementById("emailConfirm"); And finally add additional check in submit eventListener function: if(email.value.trim() !== emailConfirm.value.trim()){ errors.push("Wrong email") } This is front-end(client side) validation. If you want to learn more about front-end and the back-end you can watch my video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eRD3Bgk0iEk.html