Click this or that element in jQuery

jQuery logo

If you want to set the same action for several elements, you can write IDs of elements separated by comma. This way:

    $("#controlOne, #controlTwo").click(function () { 
                do_something(); 
    });

 

Leave a Reply

Your email address will not be published. Required fields are marked *