let out = document.querySelector('.out-9');
function t9() {
let data = document.querySelector('.i-9').value;
out.innerHTML = data;
data.value = '';
}
document.querySelector('.b-9').onclick = t9;
<form type="submit">
const elements = {
'form': document.querySelector('form'),
'text': document.querySelector('.out-9'),
'input': document.querySelector('.i-9'),
}
elements.form.addEventListener('submit', (event) => {
event.preventDefault();
const data = elements.input.value;
elements.text.innerHTML = data;
elements.form.reset();
});