Wildcards in jQuery selectors

前端 未结 6 2349
逝去的感伤
逝去的感伤 2020-11-22 06:18

I\'m trying to use a wildcard to get the id of all the elements whose id begin with \"jander\". I tried $(\'#jander*\'), $(\'#jander%\') but it doe

6条回答
  •  误落风尘
    2020-11-22 07:01

    Try the jQuery starts-with

    selector, '^=', eg

    [id^="jander"]
    

    I have to ask though, why don't you want to do this using classes?

提交回复
热议问题