Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
For example 1
$(".applyDialog").on("click",function(e){
if(e.target.className=="aaMIRight choosed"){
//执行代码
$(".applyDialog").removeClass("choosed");
}else{
return;
}
});
Example 2
$(".applyDialog").on("click",function(e){
if(e.target.classList[0]=="applyDialog"){
$(".applyDialog").removeClass("choosed");
}else{
return;
}
});