How can I select an element by ID with jQuery using regex?

前端 未结 7 1687
执念已碎
执念已碎 2020-11-28 05:51

I have the following input elements:




        
7条回答
  •  时光取名叫无心
    2020-11-28 06:26

    You can look for id's starting with AAA and ending with BBB like this:

    ​$("[id^=AAA_][id$=_BBB]")
    

    The working fiddle: http://jsfiddle.net/DN9uV/

提交回复
热议问题