@besttlookk
Posted
Hi, First of all congtratulations on completing this challenge. Tho there are few things you need to change which I am going to point out:
- When ever you use form rather that adding the eventListner on the submit-button add the eventListerner on the <form> element. When we click on button with type submit(that is very important) form automatically get submitted.
<form class="email-input-wrapper" id="form"> // no need to mention action
<input
id="user-input"
name="email" // with this we can extract the value of input.
/>
<button type="submit" id="submit-button">
<img src="images/icon-arrow.svg" alt="" />
</button>
</form>
const formEl = document.getElementById("form")
formEl.addEventListner("submit", (event) => {
event.preventDefault() ;// form has default behaviour of going to differnt url for submission. We need to avoid that
const valueEntered = event.target.email.value ; // using the name to extract the value
//DO ALL THE CHECKING HERE...ONCE EVERYTHING IS OKAY..YOU CAN CLEAR THE INPUT
//FOR THAT YOU DONT HAVE TO USE ANY TIMER. JUST RESET THE VALUE LIKE THIS.
event.target.email.value = "";
- For gradient you can refer to https://www.w3schools.com/css/css3_gradients.asp or https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
Feel free to drop a mesg incase you need any help. I am no expert but will try to help you out
Good Luck,
Happy Coding
Marked as helpful
@jesuisbienbien
Posted
@besttlookk I have modified my codes as per your suggestion and it works wonderfully. Thank you for your feedback!