@kayyrbeks
Submitted
Hi, everyone! ╰(°▽°)╯
Did I use correct CSS style? It's my first project and any feedback welcome. Thanks for your attention! (❁´◡`❁)
@Azraude
@kayyrbeks
Submitted
Hi, everyone! ╰(°▽°)╯
Did I use correct CSS style? It's my first project and any feedback welcome. Thanks for your attention! (❁´◡`❁)
@Azraude
Posted
That's great man, nice first project, keep training like that!
@MariusHor
Submitted
This was my first Javascript project on Frontendmentor after learning and doing some smaller projects on my own with js.
I think my solution is very close to the original and the js that I have implemented seems to work well. I had to look up for ways to make it work but I would say that I now understand what is the purpose of each variable, function or loop but I would definitely need more practice.
Please let me know what you think about my solution and if I can improve it somehow. 🙂
@Azraude
Posted
You should use preventDefault(), it prevent browser from refreshing.
Here is a simple solution for example, but yours is good too !
form.addEventListener('submit', function(e){
e.preventDefault();
const checkbox = "input[name=rating1]:checked";
const checked = document.querySelector(checkbox);
console.log(checkbox);
if(checked !== null){
let ratingselected = document.querySelector('.ratingselected');
ratingselected.textContent = 'You selected ' + checked.getAttribute('value')+ ' out of 5'
cardform.classList.add("hidden");
cardthanks.classList.remove("hidden");
}
})```
@Azraude
Submitted
@Azraude
Posted
Hello ! Thanks for you feedback, it help me a lot.