$("table td").click(function(){ /*……*/ })
This way of writing cannot handle dynamically added "td", so it is changed to the following:
$("table").on("click","td",function(){ /*……*/ })
But now we need to deal with a special one, which does not need to include a certain one:
$("table td").not($(".check")).click(function(){ /*……*/ }),
What I want to ask now is: How to write the parameters like above and what is the format. . .
仅有的幸福2017-05-19 10:35:20
In fact, if the class name of the current element obtained in the function contains .check
, isn’t it enough to just do a return or other processing?
It’s early in the morning and I didn’t understand the meaning of the question clearly. If you don’t want to deal with td with check
$("table").on("click","td",function(){
var thisObj = $(this);
if(thisObj.hasClass('check')){
return;
}
//继续处理没带check的
})