JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="current" data=""></input>

JavaScript

var doSomethingOnceValueIsPresent = function () {

    if ($('#current').val() != '')
    {
        alert('something!');
    }
    else
    {
        setTimeout(function(){
            doSomethingOnceValueIsPresent()
            }, 500);
    }
};

doSomethingOnceValueIsPresent();