JSFiddle - React, Tailwind, and code Playground

by TrueBlueAussie

HTML

<input type="text"/>
<input type="text"/>

JavaScript

$('input').on('focusin', function(){
    console.log("Saving value " + $(this).val());
    $(this).data('val', $(this).val());
});


$('input').on('change', function(){
    var prev = $(this).data('val');
    var current = $(this).val();
    console.log("Prev value " + prev);
    console.log("New value " + current);
});