From 3d569f7d7b7d0e61431a10ad6f730c7e19052162 Mon Sep 17 00:00:00 2001 From: student1232354 Date: Sat, 4 Jul 2026 11:13:05 +0300 Subject: [PATCH] first update --- src/scripts/main.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/scripts/main.js b/src/scripts/main.js index a765fdb1d..cdf44e4b8 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -1,3 +1,22 @@ 'use strict'; -// write code here + const inputs = document.querySelectorAll('form input'); + + inputs.forEach(function (oneinput) { + const inputName = oneinput.name; + + const normalname = inputName.charAt(0).toUpperCase() + inputName.slice(1); + + oneinput.placeholder = normalname; + + const label = document.createElement('label'); + + label.classList.add('field-label'); + label.setAttribute('for', oneinput.id); + + label.textContent = normalname; + + const div = oneinput.parentElement; + + div.insertBefore(label, oneinput); + });