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;
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38942-344d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38942-344d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?