Design comparison
Solution retrospective
First project on javascript.
Community feedback
- @deepak-parmarPosted over 2 years ago
@Arslanj9,
-
Your path to
main.js
is not working, remove/
from the beginning of it. It should be justjs/main.js
or add.
in front on it for best practice like this,./js/main.js
-
Submitting a form reloads the page, so after clicking the submit button the page reloads and returns to its original states; to prevent that use
submit
event-listener
submitBtn.addEventListener("submit", (event) => { event.preventDefault() btnClick() })
event.preventDefault()
will stop the submission process of the form.- For accessibility issue, wrap your
header
usingmain
tag
I hope this work out. keep coding 👍
Marked as helpful2@Arslanj9Posted over 2 years ago@deepak-parmar Thank you so much for your valuable feedback.
- Changing
/js/main.js
tojs/main.js
worked. Now javascript is working fine. - Submitting a form isn't reloading my page. I appreciate your feedback since i'm new to javascript and don't know much about Event Listeners, i'll study it to understand it properly because after all its all about learning.
- Oh ok, i was wondering what's that accessibility issue. I used [main] and it fixed it. Thanks again.
Regards
0 -
- @JexintePosted over 2 years ago
Hey @Arslanj9 , Great job your code is not working on live preview and even when we clone your project because you haven't write correctly your path for your js file and your css file I check it and made an update on it and it works fine on my desktop.
In hope it helps !
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord