jQuery $(“.class”).click(); - multiple elements, click event once

前端 未结 18 1649
借酒劲吻你
借酒劲吻你 2020-11-29 00:01

I have multiple classes on a page of the same name. I then have a .click() event in my JS. What I want to happen is the click event only happen once, regardless of multiple

18条回答
  •  醉梦人生
    2020-11-29 00:39

    when you click div with addproduct class one event is fired for that particular element, not five. you're doing something wrong in you code if event is fired 5 times.

提交回复
热议问题