Jquery: event listener for array of elements

前端 未结 5 1317
被撕碎了的回忆
被撕碎了的回忆 2021-01-20 13:49

I am populating an array with elements using the .each() method and $(this) selector.

(function($){

    var elements = new Array()         


        
5条回答
  •  没有蜡笔的小新
    2021-01-20 14:01

    Use a comma separated list of selectors, wrapped in quotes like so:

    $('#id, .selector, .somethingElse').click(function() {
        //your handler
    });
    

提交回复
热议问题