Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive rating component

ArslanJ9 150

@Arslanj9

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


First project on javascript.

Community feedback

@deepak-parmar

Posted

@Arslanj9,

  • Your path to main.js is not working, remove / from the beginning of it. It should be just js/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 using main tag

I hope this work out. keep coding 👍

Marked as helpful

2

ArslanJ9 150

@Arslanj9

Posted

@deepak-parmar Thank you so much for your valuable feedback.

  • Changing /js/main.js to js/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
Yokke 620

@Jexinte

Posted

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 GitHub
Discord logo

Join 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