Interactive rating component using flexbox and JavaScript
Design comparison
Solution retrospective
I am still much of a JavaScript novice and have no clue how to get the users selected rating to pop up on the thank you page can any JavaScript legends please help me!?!? At first, I tried to make an index page and thank you page and then link them to the same .js file but then I put them together and added an inline script to see if that would work. I just want to be able to get the user's input rating number to show on the thank you page what they selected.
Community feedback
- @elaineleungPosted over 2 years ago
Hi Teano, I actually saw at least two other similar comments for this challenge, and on one of them I even posted my old code, but I think it might be better to just show how it works using CodePen: https://codepen.io/elaineleung/pen/xxWzZPv
There are many ways to go about it, but this is what I think is the most straightforward. You basically put a value in the button when you write the HTML, and then in the JS, you pull that value from the element using an event listener, then you store that value and use it for the message in the Thank You page. See whether the CodePen helps you out, or you can also check out my solution to the challenge, which is a bit more complex since I'm using radio buttons, but the JS is fairly similar.
Good luck!
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