Js code has been monitored many times, how to solve it?

this code listens several times

$(document).on("click", "-sharptemp4 li", function(){
     // my codes
});

this is html,. I only need to monitor once. What can I do?

Jul.29,2021

your method is right (below), but why do you add href? to li? This is very irregular

the test on the current page is as follows:
clipboard.png


jquery seems to have a once method. Or you can add a judgment:

let once = true;
$(document).on('click', '-sharptemp4 li', function(){
     if (!once) {
         return ;
     }
     
     // do something...
     once = false;
});
Menu