Design comparison
Solution retrospective
I am most proud of completing my first challenge that included using javascript.
What challenges did you encounter, and how did you overcome them?Using js without knowing any of the fundamentals was a nightmare. I will definitely work more with js to gain a better familiarity with it for future use.
What specific areas of your project would you like help with?I would most definitely like more help with js.
Community feedback
- @CJCameron13Posted 7 months ago
Nice work! Another approach you could use is the classList.toggle feature to achieve the same functionality that you currently have. I like to add a class called 'hidden' to the element and in my CSS document, given .hidden the attribute of display:none.
.hidden { display: none; }
Using your shareButton and shareLinks identifier, the JS code would look something like this...
shareButton.addEventListener('click', () => { shareLinks.classList.toggle('hidden') } Now the 'hidden" class will toggle on and off with each click by the user. Just my preferred method. Well done with the project!
Marked as helpful0@jvisme1991Posted 7 months agoI will definitely use this! It is sometimes difficult trying to figure out an appropriate naming convention, but this is simple and precise. Thank you@CJCameron13
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