I would like to know how to place the selected rating number in a variable in order to use it in another part of the application. I tried using a function and a "for" command, but I couldn't extract and store the choosen rating number.
Halibal
@halibalAll comments
- @BernardoHollmannSubmitted about 2 years ago@halibalPosted about 2 years ago
As an alternative you can use "dataset" for storing values inside the the selected element. When you loop inside all your buttons, you can use "rating.dataset.(the name you used while assigning to the data)"
i.e: <button data-value="1">First Button</button> console.log(document.querySelector("button").dataset.value) -> prints // 1
Marked as helpful0 - @halibalSubmitted about 2 years ago@halibalPosted about 2 years ago
Page content created with JavaScript file and apparently frontendmentor screenshots doesn't take it into account. This is the second time seeing this issue.
0 - @halibalSubmitted about 2 years ago@halibalPosted about 2 years ago
The chart components added with using JavaScript, so it is strange not showing up on design comparison page :) Check out the live site to see how it actually looks..
0