Conversation
jk-npc
commented
Mar 5, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Good work on the logic for creating the labels and setting the placeholders! The implementation for each individual input is correct. However, a change is needed because the script currently only modifies the very first input element on the page. This happens because you're using document.querySelector('input'), which is designed to return only the first element it finds. To fix this and apply your logic to all inputs, you should use document.querySelectorAll('input') instead. This method will return a collection of all input elements, which you can then correctly iterate over with .forEach().
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
src/scripts/main.js
Outdated
| 'use strict'; | ||
|
|
||
| // write code here | ||
| const inputs = document.querySelector('input'); |
There was a problem hiding this comment.
The document.querySelector() method returns only the first element that matches the selector. The task requires getting all input elements. You should use document.querySelectorAll('input') to get a NodeList containing all inputs. With the current code, the .forEach() method on line 6 will throw an error because it's being called on a single element, not a list of elements.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this task! I am approving your solution. You've successfully addressed the previous feedback by using querySelectorAll to ensure the script modifies all input elements on the page. The code now correctly generates and appends a label and a capitalized placeholder for every input, meeting all requirements perfectly. Great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨