Skip to content

Commit

Permalink
task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
OwlDevcUA committed Mar 2, 2025
1 parent c5d4dde commit 8ef928c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
'use strict';

// write code here
const inputs = document.querySelectorAll('input');

inputs.forEach((input) => {
const label = document.createElement('label');

label.setAttribute('class', 'field-label');
label.setAttribute('for', input.id);
label.textContent = input.name;

input.parentNode.insertBefore(label, input);
});

inputs.forEach((input) => {
input.setAttribute('placeholder', input.name.toUpperCase());
});

0 comments on commit 8ef928c

Please sign in to comment.