JSFiddle - React, Tailwind, and code Playground

HTML

<input id="input1" type="text" class="input"/><br/>
<input id="input2" type="text" class="input"/><br/>
<input id="input3" type="text" class="input"/><br/>

<div id="preview">
    <div>Input 1: <span class="input1"></span></div><br/>
    <div>Input 2: <span class="input2"></span></div><br/>
    <div>Input 3: <span class="input3"></span></div>
</div>

JavaScript

$('.input').keyup(function(){
   var $this = $(this);
   $('.'+$this.attr('id')+'').html($this.val());
});