Skip to content

solution#1830

Open
jk-npc wants to merge 4 commits intomate-academy:masterfrom
jk-npc:develop
Open

solution#1830
jk-npc wants to merge 4 commits intomate-academy:masterfrom
jk-npc:develop

Conversation

@jk-npc
Copy link

@jk-npc jk-npc commented Mar 5, 2026

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

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

  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.querySelector('input');

Choose a reason for hiding this comment

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

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.

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

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