Colon in Jquery selector

后端 未结 2 358
遇见更好的自我
遇见更好的自我 2021-01-28 01:54

I have recntly updated my jquery from 1.4 to 2.1 and an error started appeared.

In my code I have a part where I select the elements with by an id.

jQuery(

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 02:38

    you can wrap the attribute value like a string literal

    jQuery('*[id^="name:"]')
    

    Demo: Fiddle

提交回复
热议问题