JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.js"></script>
    
    <script>
        window.onbeforeunload = function() { return "hello"; }
        
        $(document).ready(function() {
           alert("before:\n\n" + window.onbeforeunload);
        
           $("#field1").autocomplete();
        
           alert("after:\n\n" + window.onbeforeunload);
        });
    </script>
</head>
<body>
    <form>
       <input type="text" id="field1">
    </form>
</body>
</html>