Jquery .on with doubleclick event

后端 未结 3 891
星月不相逢
星月不相逢 2021-02-06 20:15

Why would this work :

$(document).on(\"dblclick\", \"#areaA tr:has(td)\", function(e) {
     //code here
 });

and this does not



        
3条回答
  •  借酒劲吻你
    2021-02-06 20:59

    The main difference is that the condition in the first one will be checked each time you click. So if the element with id areaA or the tr or td inside is added dynamically, only the first one can work.

提交回复
热议问题