Js click to achieve style switching should be written?

<ul class="left_menu" id="button">
<li><a href="/" class="m cur"><span></span></a></li>
<li><a href="/" class="m"><span></span></a></li>
<li><a href="/" class="m"><span></span></a></li>
<li><a href="/" class="m"><span></span></a></li>
<li><a href="/" class="m"><span></span></a></li>
</ul>

the default is that the member home page class adds cur, to achieve when clicking on other pages, the cur of the member home page is removed, and the clicked page class adds cur
Thank you!

Oct.15,2021

idea:
Click li trigger event
remove cur with or without cur all li
Last li currently clicked add cur

I don't know what plug-ins you use
Native direct traversal to modify class
jq provides operations such as addClass removeClass

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-1b3ff58-2ba20.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-1b3ff58-2ba20.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?