How does jquery encapsulate the code as a plug-in that is called in each page without having to write the same class name ID name?

$(function(){
    var isBox = false; 
    $("-sharpselect").hide();   
      
    $("-sharpinput_select").focus(function () { 
      $(this).siblings("-sharpselect").show();   
      isBox = true;  
    });  
    $("-sharpmousemove").mousemove(function () { 
      isBox = true;  
    });  
    $("-sharpmousemove").mouseout(function () { 
      isBox = false;  
    });  
    $("-sharpinput_select").blur(function () { 
      if (isBox == true) return false;  
      $("-sharpselect").hide();  
    });  
    $("-sharpselect").find("li").each(function () { 
      $(this).on("click", function () {  
        isBox = false;  
        var text = $(this).text();  
        $("-sharpinput_select").val(text);  
        $("-sharpselect").hide();  
      })  
    })
})
Mar.11,2021
Menu