Eudes Serpa
@EudesSerpaAll comments
- @EudesSerpaSubmitted almost 2 years ago@EudesSerpaPosted almost 2 years ago
The screenshot is wrong ๐ not quite sure why. It's like it's taken at about 600px wide. How I can improve it?
0 - @AlexAgustiniSubmitted almost 2 years ago
First project with JS. Open to any suggestions about my script code, how i could have written it better, in terms of efficiency, size, and performance overall. Not really looking for html or css suggestions because right now i'm focusing more on JS. Thanks! One doubt i had, that i tried to fix but couldn't while doing the challenge, was when i tried to make the if statement that creates the warningMsg variable, creates it only once, and after another clicks, stops creating it. At first, if i spammed the submit btn it just kept showing up more warning messages, because they were being created each time. The solution i came up with was just creating the variable in the global scope and just appending it after. It worked. But i think the other way would be cleaner, since i would only create an element if needed. So, if someone could give me an idea, thanks!!
@EudesSerpaPosted almost 2 years agoHello! Well I have seen your code and your comment on comments. But in my opinion, if you want to improve your Js skills for the web, you should improve your html (and css) skills because a good html document leads to a good Js code. In your case, I have seen that you create the thank you card with Js, which is not bad and cool, seeing that you want to give everything to Js. In that case, my advice is to create a function for the creation of the card since you repeat a bit the logic of creating an element, assigning an attribute or text content and a class. Like I said before, if you have a good html document, you have a good js. If you improve your form: change the buttons to grouped radio buttons, since in this case only a single option is required, and you will have a cleaner code. So when managing a form, if you use the corresponding elements that will give you input for better Js.
If it is of interest to you, you can see my code and give your opinion if you want. The idea is that you see how I handle the form and how having a good html can help you to make your js cleaner. https://github.com/EudesSerpa/FM-interactive_rating_component
Marked as helpful0