JSFiddle - React, Tailwind, and code Playground
by agentmilindu
HTML
<input id="product" id="product" type="text" />
<div class="companydiv">Product result will be shown here</div>
JavaScript
//".change" function will be called once you have finished typing and get out of the text box.On what event this should be trigered is up to you and change it as your flavor. you may like ".keyup()"
$('#product').change(function(){
getcompany(this);
});
function getcompany(element) {
alert("My method is called");
$.get("/echo/html/","product=" + element.value,function(data){
alert("My ajax request got a response");
$('.companydiv').html("Hmm.."+data);
} );
}