JSFiddle - React, Tailwind, and code Playground

by Silambarasan_sundaram

HTML

<p><input type="text" id="val1"> <span>focus fire</span></p>
<p><input type="password"> <span>focus fire</span></p>

JavaScript

/*
$(document).ready(function(){
    $("input[type=text]").on('change',function(event){
         var currentId = $(this).attr('id');
        alert(currentId);
    }
}
                 
                  
                 $(document).ready(function() {
    $('input').live("focus", function() {
        var currentId = $(this).attr('id');
       $("#"+currentId).val('blah');
    });
});
                 */
              $(document).ready(function() {
$( "input" ).change(function() {
  var val1 = $( this ).attr('id');
    alert(val1);
});
              });