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

Menu