diff --git a/src/scripts/main.js b/src/scripts/main.js index a765fdb1d..7fae188e6 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -1,3 +1,15 @@ 'use strict'; -// write code here +document.querySelectorAll('form input').forEach((input) => { + const label = document.createElement('label'); + + label.className = 'field-label'; + + label.htmlFor = input.id; + + label.textContent = input.name[0].toUpperCase() + input.name.slice(1); + + input.placeholder = label.textContent; + + input.before(label); +});