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 Pages

@Robert0362

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Marius 100

@ir4M

Posted

Remember the script tag in index.html to refer to your script.js file, otherwise the code will not executed.

Typically you place it before the body close or at the bottom of the HTML file. If you place it in the head section the JavaScript file is executed immediately and tries to access the submit id you created in the HTML file before it is has been rendered by the DOM (Document Object Model). Maybe search for DOM to become familiar how documents are structured and the way a document is accessed and manipulated.

But you can still place the script tag in the head section, if you make sure to place your JavaScript code in the DOMContentLoaded event listener like this:

document.addEventListener('DOMContentLoaded', () => {
// place your JavaScript code here and it only executes if the HTML file is fully loaded
})

Note that you are currently try to access the class cardRating and cardThank by getElementById. If you change that, it should work.

0

@Robert0362

Posted

@ir4M I know for some reason my buttons were not clickable I was just putting that up to see some solution to look for help on why my buttons were not clickable

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