:nth-of-type() in jQuery / Sizzle?

后端 未结 3 1499
旧时难觅i
旧时难觅i 2020-11-30 08:46

It surprised me that Sizzle (the selector engine jQuery uses) comes with a built-in :nth-child() selector, but lacks an :nth-of-type() selector.

3条回答
  •  孤街浪徒
    2020-11-30 09:21

    I can't pretend to know how nth-of-type is implemented, but jQuery does provide a mechanism by which you can create your own custom selector.

    The following question deals with custom selectors, and may provide a useful insight to you

    What useful custom jQuery selectors have you written?

提交回复
热议问题