Develop #3
9
js.js
9
js.js
@ -3,9 +3,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
const inputFile = document.querySelector('#input__img');
|
const inputFile = document.querySelector('#input__img');
|
||||||
const labelInput = document.querySelector('.label-input');
|
const labelInput = document.querySelector('.label-input');
|
||||||
|
|
||||||
const textSpanInput = "Imagem";
|
const textLabelInput = "Imagem";
|
||||||
|
|
||||||
labelInput.innerHTML = textSpanInput;
|
labelInput.innerHTML = textLabelInput;
|
||||||
|
|
||||||
inputFile.addEventListener('change', (e) => {
|
inputFile.addEventListener('change', (e) => {
|
||||||
const inputTarget = e.target;
|
const inputTarget = e.target;
|
||||||
@ -25,11 +25,14 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
labelInput.appendChild(img);
|
labelInput.appendChild(img);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
labelInput.innerHTML = "";
|
labelInput.innerHTML = "";
|
||||||
|
labelInput.style.border = "none";
|
||||||
|
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
labelInput.innerHTML = textSpanInput;
|
labelInput.innerHTML = textLabelInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user