JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css" type="text/css" media="all" />

<div onclick="check_domain_input()">Click</div>

<div id="dialog" title="Attention!" style="display:none">
    Please enter a domain name to search for.
</div>

<script>
    function check_domain_input()
    {        
        $( "#dialog" ).dialog(); // Shows the new alert box.
    
        var domain_val = document.getElementsByName('domain');
        
        if (domain_val[0].value.length > 0)
        {
            return true;
        }
        
        $( "#dialog" ).dialog();
    
        return false;
    }
</script>