I'm wanting to have multiple input fields have a live output without having to hit submit and have the ability to copy/paste the output.
Ex:
<input id="name1">
<input id="name2">
IF name1 is not empty, then display: Hi name1
IF name1 and name2 is not empty, then display: Hi name and name2
I saw another post: Printing field input data live with Javascript that comes close to what I'm looking for but not quite.
This might be something simple but I'm struggling with it.
Thanks
You can to handler it with javascript
// select element input
const input = document.querySelector('input');
// select element output
const log = document.getElementById('values');
// event listener invoke when something change in input
input.addEventListener('input', updateValue);
// method
function updateValue(e) {
log.textContent = e.target.value;
}