Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this task! Your script correctly adds the required labels and placeholders, and the form's functionality is perfect. I am approving your solution as it meets all the core requirements.
One small suggestion for future improvement: the task asked to select inputs from within the form tag. Your selector document.querySelectorAll('.field-text') queries the entire document. A more precise approach would be document.querySelectorAll('form .field-text'). This scopes the search to just the form, making the code more robust if other elements with the same class existed elsewhere on the page. This is just a best practice tip for an otherwise great submission. Keep up the fantastic work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| 'use strict'; | ||
|
|
||
| // write code here | ||
| const inputs = [...document.querySelectorAll('.field-text')]; |
There was a problem hiding this comment.
According to the task description, you should "Get all inputs from form tag on the page". Your current selector '.field-text' selects these elements from the entire document. It's better practice to scope your selector to the form, for instance, by using 'form .field-text', to make the code more robust and aligned with the requirements.
DEMO LINK