diff --git a/src/scripts/main.js b/src/scripts/main.js index a765fdb1..9b8115fd 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -1,3 +1,17 @@ 'use strict'; -// write code here +const inputElemet = document.querySelectorAll('form input'); + +inputElemet.forEach((input) => { + const label = document.createElement('label'); + + label.setAttribute('for', input.id); + + label.classList.add('field-label'); + + label.textContent = input.name.charAt(0).toUpperCase() + input.name.slice(1); + + input.placeholder = input.name.charAt(0).toUpperCase() + input.name.slice(1); + + input.parentElement.appendChild(label); +});