jQuery selector regular expressions

前端 未结 10 2431
傲寒
傲寒 2020-11-21 22:36

I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.

I have looked for this myself but have

10条回答
  •  野的像风
    2020-11-21 23:16

    James Padolsey created a wonderful filter that allows regex to be used for selection.

    Say you have the following div:

    Padolsey's :regex filter can select it like so:

    $("div:regex(class, .*sd.*)")
    

    Also, check the official documentation on selectors.

提交回复
热议问题