Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
'use strict';

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

inputs.forEach((input) => {
const label = document.createElement('label');

label.classList.add('field-label');
label.setAttribute('for', input.id);
input.placeholder = input.name[0].toLocaleUpperCase() + input.name.slice(1);
input.parentElement.append(label);
label.textContent = input.name;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The label's text should be capitalized, just like the placeholder. Currently, it's being set to the lowercase name attribute (e.g., 'email'). According to the requirements and the example image, it should be capitalized (e.g., 'Email').

});
Loading