how to pass javascript variable value to another javascript function? : I need to pass javascript variable value to another javascript function

    $("#myTabs form").on('submit', function (e) {
    
                    e.preventDefault();
                    var linkHref = $(this).parents('.tab-pane').attr('id');
                    $('#myLinks li a').removeClass('active');
                    $('#myLinks li')
                      .find('a[href="#' + linkHref + '"]')
                      .parent()
                      .next()
                      .find('a')
                      .tab('show')
                      .addClass('active')
                      .attr('data-toggle', 'tab');
    
                    $('a.nav-link').not('.active').css('pointer-events', 'none');
    
                    var SAPno = linkHref;
                    
                });
    
                $('a.nav-link').not('.active').css('pointer-events', 'none');


For Example `var SAPno`   value need to the passed to another javascript function


    function GetInfo() {
    
    var ID = SAPno;
    }

