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

后端 未结 4 1983
旧时难觅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:19

    In this situation you should use class. You can not use id. Otherwise you can try the below code.

    jQuery('ul').jcarousel();
    

提交回复
热议问题