You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dom-manipulation/exercise/script.js
-20Lines changed: 0 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -69,23 +69,3 @@ const countries = [
69
69
// Use a li to display the country.
70
70
// Add an img to each country to display the flag of each country.
71
71
// Append each country to the correct part of the DOM (e.g., Germany should be added to the Europe list since it's part of Europe, whereas Japan should be added to Asia)
// EXERCISE 1: Use JavaScript to display an error message "You must select a topic" below to the Topic dropdown menu if the option selected is "Select One"
70
53
71
54
// Use JavaScript to display an error message below the text area if the content is
72
55
// less than 10 characters long when the user submits the form. Your error message
@@ -103,30 +86,11 @@ function handleOtherInterestsTextAreaInput(event) {
103
86
- If the provided input is too short, display the following error message: "Email should be at least 6 characters but you entered {X} characters."
104
87
- Perform the validation as the user is typing into the input field (meaning you should use the "input" event), as well as, when the user submits the form.
105
88
*/
106
-
functionhandleEmailInput(){
107
-
constemailValidity=emailInput.validity;
108
-
109
-
if(emailValidity.valid){
110
-
emailError.textContent="";
111
-
emailError.classList.add("error");
112
-
}else{
113
-
if(emailValidity.valueMissing){
114
-
emailError.textContent="You need to provide an e-mail address.";
115
-
}elseif(emailValidity.typeMismatch){
116
-
emailError.textContent="Please enter a valid e-mail address.";
117
-
}elseif(emailValidity.tooShort){
118
-
emailError.textContent=`Email should be at least ${emailInput.minLength} characters but you entered ${emailInput.value.length}.`;
0 commit comments