Frontend Mentor Help
How can I have the active styling stay focused when clicked, and also how can I store the value in the li when the user clicks submit?
Code: https://jsfiddle.net/e36dztjo/2/
13 Replies
I used li's because I couldn't get the right styling on radio buttons. The only thing I could style were their width
you'd probably want to hide the radio buttons, and have the li's like this
check out Kevins latest video (yesterday). he did style the radio buttons in that
there are different ways to do it. here a quick fiddle, based on what kevin did
https://codepen.io/MarkBoots/pen/mdKPeVE
yeah radio buttons with labels seems the best choice
also added the js logic
Thanks, guys!
Could you please explain line 5 and the highlighted red or possibly link to a resource?
it is the same as
event is an object from the listener that holds the 'currentTarget', I destructured it
({currentTarget})
it already as the parameter, and renamed it as 'form' ({currentTarget:form})
Oh okay
And line 5 gets the rating through some sort of get method?
FormData() - Web APIs | MDN
The FormData() constructor creates a new FormData object.
What's
new FormData
btw
Oh okay, perfect, thanks!get("rating") is "name=rating" atrribute in the html input element
Hey, quick question, is it better to use your method to submit a form using JS, or is it better to submit a form inside the HTML itself?