From 36021b29b0d72567524a3590b567975cbbe22b68 Mon Sep 17 00:00:00 2001 From: ptrodion Date: Sat, 27 Jun 2026 20:52:29 +0100 Subject: [PATCH 1/3] add task solution --- src/scripts/main.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/scripts/main.js b/src/scripts/main.js index a765fdb1d..4cd5d0173 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -1,3 +1,19 @@ 'use strict'; -// write code here +const elementForm = document.querySelectorAll('form input'); + +elementForm.forEach((element) => { + const label = document.createElement('label'); + const { id, name: textContent } = element; + + const formattedName = + textContent.charAt(0).toUpperCase() + textContent.slice(1); + + element.placeholder = formattedName; + + label.textContent = textContent; + label.setAttribute('for', id); + label.classList.add('field-label'); + + element.before(label); +}); From a1b98612eeba7555e7f13cc02498f129116dbe77 Mon Sep 17 00:00:00 2001 From: ptrodion Date: Sat, 27 Jun 2026 20:58:52 +0100 Subject: [PATCH 2/3] add task solution-2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d24722b51..a81057831 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ 1. Replace `` with your Github username in the link - - [DEMO LINK](https://.github.io/js_task_fix_form_DOM/) -2. Follow [this instructions](https://mate-academy.github.io/layout_task-guideline/) + - [DEMO LINK](https://ptrodion.github.io/js_task_fix_form_DOM/) +2. Follow [this instructions](https://ptrodion.github.io/layout_task-guideline/) - Run `npm run test` command to test your code; - Run `npm run test:only -- -n` to run fast test ignoring linter; - Run `npm run test:only -- -l` to run fast test with additional info in console ignoring linter. From ba814f873570b03ebb344bbe8fe94bef52ecd71a Mon Sep 17 00:00:00 2001 From: ptrodion Date: Sat, 27 Jun 2026 21:02:44 +0100 Subject: [PATCH 3/3] add task solution-3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a81057831..0bf699791 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ 1. Replace `` with your Github username in the link - [DEMO LINK](https://ptrodion.github.io/js_task_fix_form_DOM/) -2. Follow [this instructions](https://ptrodion.github.io/layout_task-guideline/) +2. Follow [this instructions](https://mate-academy.github.io/layout_task-guideline/) - Run `npm run test` command to test your code; - Run `npm run test:only -- -n` to run fast test ignoring linter; - Run `npm run test:only -- -l` to run fast test with additional info in console ignoring linter.