Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because there are still two critical checklist violations that will cause the task to fail. First, in src/scripts/main.js, you currently select all input elements in the document (e.g. document.querySelectorAll('input')), but the requirement is to get only the inputs inside the form tag, such as via form.querySelectorAll('input') or document.querySelectorAll('form input'); otherwise, labels and placeholders may be incorrectly added to non-form inputs. Second, you are assigning a string directly to label.classList, which is a DOMTokenList and not meant to be replaced with a string; this means the label may not reliably get the required class. The requirement states the label’s class must be exactly field-label, so you should set it using something like label.className = 'field-label' or label.classList.add('field-label') to meet that constraint. Once you update the input selection to target only form inputs and correct the label class assignment, your implementation should align with the functional and checklist requirements. Overall, your use of the input name for label text and placeholder and your approach to inserting labels look good, so you’re very close—these targeted fixes will complete the solution.
✨ 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.querySelectorAll('input'); |
There was a problem hiding this comment.
The code selects every input in the document. The task requires getting inputs from the form tag on the page (e.g. form.querySelectorAll('input') or document.querySelectorAll('form input')). Update this line so inputs are taken only from the form element.
src/scripts/main.js
Outdated
| for (const input of inputs) { | ||
| const label = document.createElement('label'); | ||
|
|
||
| label.classList = 'field-label'; |
There was a problem hiding this comment.
You should not assign a string to label.classList. classList is a DOMTokenList and assignment like this may not work. The requirement also mandates the label class must be exactly field-label. Use either label.className = 'field-label' or label.classList.add('field-label') to set the class correctly.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this iteration! I'm happy to approve your solution. You've successfully addressed all the feedback from the previous review, and your script now correctly targets only the inputs within the form while properly assigning the field-label class. Your implementation is clean, effective, and fully meets all task requirements. Well done!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.