JSFiddle - React, Tailwind, and code Playground
HTML
<div class="clicker_class" style="padding:10px; background-color:yellow;">The Button</div>
<div class="show_menu_users" style="padding:10px; background-color:red;">The User Menu</div>
CSS
body {
width:100%;
height:100%;
}
JavaScript
$( document ).ready( function () {
$( ".clicker_class" ).on( "click", function ( event ) {
event.stopPropagation();
$( ".show_menu_users" ).toggle();
});
$( document ).on( "click", function () {
$( ".show_menu_users" ).hide();
});
$( ".show_menu_users" ).on( "click", function ( event ) {
event.stopPropagation();
});
});