How can I apply a jQuery function to all elements with the same ID?

后端 未结 4 1980
旧时难觅i
旧时难觅i 2020-11-22 10:46

I am new to jQuery. I have the following code:

jQuery(document).ready(function() {
    jQuery(\'#carousel\').jcarousel();
});

It only appl

4条回答
  •  情书的邮戳
    2020-11-22 11:32

    In recent versions of jQuery, when you have multiple id's on the page, selector will return only the first 'id' that was found in the DOM. You should use class instead.

提交回复
热议问题