Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihakurochkin committed Jan 30, 2025
1 parent c5d4dde commit 37a7c77
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
'use strict';

// write code here
const collection = document.querySelectorAll('.field');

for (const field of collection) {
const child = document.createElement('label');

child.textContent = field.children[0].name.toUpperCase();
child.class = 'field-label';
child.for = field.children[0].id;

field.children[0].placeholder =
field.children[0].name[0].toUpperCase() + field.children[0].name.slice(1);
field.prepend(child);
}

0 comments on commit 37a7c77

Please sign in to comment.