From 8143d3bf9b623626455feafa2d78f5cafd0569ae Mon Sep 17 00:00:00 2001 From: interpunktus <240490702+interpunktus@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:01:54 +0300 Subject: [PATCH] try1 --- src/scripts/main.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/scripts/main.js b/src/scripts/main.js index a765fdb1d..fb45173d8 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -1,3 +1,22 @@ 'use strict'; // write code here + +const allInputs = document.querySelectorAll('form input'); + +function capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +allInputs.forEach((input) => { + const label = document.createElement('label'); + + label.classList.add('class'); + + label.classList.add('field-label'); + label.setAttribute('for', input.id); + label.textContent = capitalize(input.name); + + input.placeholder = capitalize(input.name); + input.parentElement.append(label); +});