Easy there, pal!
To access the Scrolling and operators challenges in the JavaScript basics, you need to sign up and subscribe first.
Muffin has decided to find out what visitors think about the Flashnews news portal. He created a survey page to gather their feedback. To save users time, Muffin wants users to choose a rating from 1 to 5 by selecting one of a group of radio buttons.
The group of radio buttons allows the user to select one option out of several proposed ones. Only one radio button can be active in a single group. If you select another radio button, then the previous one will be automatically unselected.
To rate the news portal, users must select the radio button for the rating that they would like to leave and then submit the form.
The results of the survey showed that not all users are delighted with the site. Muffin was upset… And then he decided that he needed to urgently refine the survey page!
The plan is as follows: if the user selects a good rating, then everything can work as it should. But if the user tries to leave a bad rating, then the submit button should be blocked, and the user should be told that an error occurred.
Muffin has assigned you the task of writing the script. Here are some things to keep in mind:
review class.onchange event handler to each radio button.data-evaluation attribute. If the review is good, then the value of this attribute is 'good', and if the review is bad, then it is 'bad'.submit-button class. If the user tries to leave bad feedback, the button must be blocked, but if they want to leave good feedback, then it should be unblocked.shown class to the element with the error class. This message should be displayed if the user tries to leave a bad rating. If the user decides to leave good feedback, then the error message should be hidden.You’ve gone to a different page
Click inside the mini-browser to shift the focus onto this window.
To access the Scrolling and operators challenges in the JavaScript basics, you need to sign up and subscribe first.
Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.
Forgot to connect your email to the profile? Email us and we’ll help.