Skip to content

completed the task#1817

Open
SerhiyShimko wants to merge 2 commits intomate-academy:masterfrom
SerhiyShimko:develop
Open

completed the task#1817
SerhiyShimko wants to merge 2 commits intomate-academy:masterfrom
SerhiyShimko:develop

Conversation

@SerhiyShimko
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

'use strict';

// write code here
const inputs = document.querySelectorAll('input');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

for (const input of inputs) {
const label = document.createElement('label');

label.classList = 'field-label';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants