Article Preview Component

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.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @CJCameron13
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 helpful
Join 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