HTML has several BTN trigger toggle function, want to realize the function is: Click each toggle the other toggle function count All clear zero, tried removedata not work, whether there is a better way?
Let's give you an example to refer to the next
Please refer to this: JSP page
<li>
<label class= "labeltext" > Statistical type:</label>
<span class= "Sortbox" >
<a href = "javascript:;" data-type= "Subject" > by subject Statistics </a>
<a href= "javascript:;" data-type= "Classlevel" > By grade statistics </a>
<a href= "javascript:;" data-type= "Lower" > by sub-statistics </a>
</span>
</li >
JS Code:
$ ('. Sortbox '). On (' Click ', ' a ', function () {
$ (this). AddClass (' selected '). Siblings (). Removeclass (' selected ');
} ) ;
$ ('. Sortbox a ') [0].click ();
The above mentioned is the entire content of this article, I hope you can enjoy.