-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add task solution #903
base: master
Are you sure you want to change the base?
add task solution #903
Conversation
Luk2asz
commented
Jul 18, 2023
- DEMO LINK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check my comments
src/scripts/main.js
Outdated
label.setAttribute('for', input.getAttribute('id')); | ||
label.textContent = input.getAttribute('name'); | ||
|
||
let placeholder = label.textContent.charAt(0).toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could write:
let placeholder = label.textContent.charAt(0).toUpperCase(); | |
const placeholder = input.name[0].toUpperCase() + input.name.slice(1) |
src/scripts/main.js
Outdated
const inputs = document.querySelectorAll('input'); | ||
|
||
for (let i = 0; i < inputs.length; i++) { | ||
document.createElement('label'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this line? remove it if it is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments
src/scripts/main.js
Outdated
label.setAttribute('for', input.getAttribute('id')); | ||
label.textContent = input.getAttribute('name'); | ||
|
||
// let placeholder = label.textContent.charAt(0).toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
src/scripts/main.js
Outdated
// let placeholder = label.textContent.charAt(0).toUpperCase(); | ||
const placeholder = input.name[0].toUpperCase() + input.name.slice(1); | ||
|
||
// placeholder += label.textContent.slice(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :)