Home >Web Front-end >JS Tutorial >How to use jquery to achieve label switching effect and click selection effect
The first step is to bind the click effects to all tab pages or rows that need to be switched using $(".delEquSign").on("click",function(){}).
The second step is to obtain the clicked object when clicking. You can perform specific operations. Usually, you also need to operate on non-clicked objects. The previous idea was to obtain a non-this object in the form of this, but on the Internet After looking for a very suitable method for a long time, I finally used $.each to loop through all the objects with bound effects, and then perform operations.
The third step is to loop first every time you click, and then operate on this.
$(".delEquSign").on("click",function(){
$.each($(".delEquSign"), function(index,item) {
($(item).css("background-color","#dedede")){
.find("input").css("background-color","#FFFFFF");
}
; dedede");
$(this).find("input").css("background-color","#dedede");
});
The above is the detailed content of How to use jquery to achieve label switching effect and click selection effect. For more information, please follow other related articles on the PHP Chinese website!