Why is the method in this click event not executed?

pseudo code is as follows;

</script>
<script>

    $(function(){

        $("-sharpeng").on("click", function(){

            fn1();
            fn2();
            fn3();

        });

        function fn1(){
            console.log("fn1");
        };
        function fn2(){
            console.log("fn2");
        }
        function fn3(){
            console.log("f3");
        }

    });


    function fnK1(){
        console.log("fnK1");
    }
    function fnK2(){
        console.log("fnK2");
    }
    function fnK3(){
        console.log("fnK3");
    }

    fnK1();
    fnK2();
    fnK3();



</script>

the logic here is that the three methods fnK1 (), fnK2 (), fnK3 () are loaded normally; after clicking the id=eng link, load the three methods in the click event;

< hr >

updated the pseudo code of the main building, you can run it locally;
extracted the code and wrote a demo to locate the problem, and all three methods fn1 () were executed; I know that this problem is caused because the three methods fnK1 () are executed in the last sequence; therefore, there should be something wrong with the logic of this code.


verified and executable. Ask a weak question, does your script prompt and warn in the browser developer tool: will there be no introduction of jQuery, or an error in this newspaper


there will be no problem. You simplify several functions to output only some text, excluding errors in the function execution script


you do not explain this problem and ignore the introduction of errors. If your script is on top of your body header, that's what you're talking about. Please click on the test location details


where the a tag should refresh the current page by default, and clicking on it will not trigger the click event, a plus href= "javascrip:;" "it should be fine


browser reasons, jquery version problems will occur these problems, it is recommended that you console

Menu