The pop-up box shows and conceals the problem.

requirement: click anywhere outside the pop-up box, and the pop-up box disappears

my code:

$(document).click(function (e) {
    var _con = $("-sharpregister");
    var _login=$("-sharplogin");
    if (!_con.is(e.target) && _con.has(e.target).length === 0 || !_login.is(e.target) && _login.has(e.target).length === 0 ) {
        $("-sharpregister").hide()
        $("-sharplogin").hide()
    }
})

result: the requirement can be fulfilled, but the click pop-up box itself and its input box will disappear. Solve

Jan.08,2022
The
$(document).click(function(e){
                   if(.currentTarge === e.target){// 
                       //
                   };
            })

keyword is used by e.stopPropagation
in the future, and you need to know more about it.

Menu