Submitted over 1 year ago
Rating component with dynamic content creation using DocumentFragment
@jefflangtech
Design comparison
SolutionDesign
Solution retrospective
I haven't yet used a framework. Using vanilla JS while dynamically updating content can be quite tedious. I did create a utility function to create a new element and add it to a parent, but much of the other functionality I just left inside the event listener body. Not the best but this is just a small component. However, I did enjoy using documentFragement to update the DOM in one swoop, so let me know what you think of that and if you have any tips or ideas!
Community feedback
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