Conversation
timurradkevic
commented
Apr 6, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on this task! You've correctly created the labels and placeholders, and the overall logic for iterating through the inputs is solid. However, some changes are needed because the labels are not being correctly linked to their inputs, which is a core requirement. In JavaScript, for is a reserved keyword, so you cannot use it as a property name. To set the for attribute on a label, you must use the htmlFor property: label.htmlFor = input.id;. Also, to be more precise and meet the task requirements, please update your selector to get only inputs within the form by using document.querySelectorAll('form input'). After these fixes, your solution will be ready!
✨ 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
| 'use strict'; | ||
|
|
||
| // write code here | ||
| const inputs = [...document.querySelectorAll('input')]; |
There was a problem hiding this comment.
The task asks to get all input elements from the form tag. This selector gets all inputs on the page, regardless of whether they are in a form. To be more precise and adhere to the requirement, consider using document.querySelectorAll('form input').
| const label = document.createElement('label'); | ||
|
|
||
| label.className = 'field-label'; | ||
| label.for = input.id; |
There was a problem hiding this comment.
Because for is a reserved keyword in JavaScript, you cannot use it as a property name to set the for attribute. Instead, you should use the htmlFor property: label.htmlFor = input.id;.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this task! You've successfully addressed all the feedback from the previous review. The code now correctly uses htmlFor to link labels to inputs and precisely selects only the inputs within the form. Your solution is clean, efficient, and fully meets all the requirements. I am happy to approve your submission. Great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨