JSFiddle - React, Tailwind, and code Playground

by pedromendessk

HTML

<input type='text' />

JavaScript

$("input").change(function(){
    alert("Input text changed!");
});

function changeTextProgrammatically(value) {
    $("input").val( value );
    $("input").trigger( 'change' ); // Triggers the change event
}

changeTextProgrammatically( "A" );