complete task#1540
Conversation
hardixxxxx
commented
Feb 28, 2025
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Great job on implementing the required functionality! 🎉 Your code is well-structured and meets the task requirements. While the current approach works, keep in mind that changes to the DOM structure might affect the selection of elements. In future projects, consider ensuring that your script runs after the DOM is fully loaded or use event listeners for dynamic content. Keep up the good work! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
| const list = document.querySelector('ul'); | ||
| const employees = document.querySelectorAll('li'); |
There was a problem hiding this comment.
The selection of ul and li elements using document.querySelector and document.querySelectorAll assumes that these elements are present in the DOM at the time this script runs. If the DOM structure changes or if these elements are dynamically added, this could lead to issues. Consider ensuring that the script runs after the DOM is fully loaded or use event listeners to handle dynamic content.