jQuery selector help - how to find element whose ID starts and ends with specific characters

后端 未结 2 1461
-上瘾入骨i
-上瘾入骨i 2021-01-12 02:30

I have a page that\'s created dynamically. It can have a number of different radio buttons with ID\'s like so:



        
2条回答
  •  梦毁少年i
    2021-01-12 02:55

    Filter your selector using the "ends with" selector.

    http://api.jquery.com/attribute-ends-with-selector/

    $('[id^="cc-"]').filter('[id$="idx"');
    

    And make sure to include quotes.

提交回复
热议问题