JSFiddle - React, Tailwind, and code Playground

HTML

<div id="setting" style="background-color:gray; width:100px">
    this is setting button
</div>    

<br/>

<div id="settingswindow" tabindex="-1" style="background-color:gray; width:300px; display:none">
    this is setting Window
</div>

JavaScript

$(function(){
    
$('#setting').click(function() {
    $("#settingswindow").show();
    $("#settingswindow").focus();
});

$('#settingswindow').focusout(function() {
    $("#settingswindow").hide();
});
    
});