Using jquery, how can I select all the DIVs in my document with ID names containing specific text?
Using jquery, how can I select all the DIVs in my document with ID names containing specific text?

I want to select all the elements that contain 'parent', the problem is the string parent might be in the middle of the string.

I've been trying to use:
    
    var allcontent_collection = $('div[id^=.*parent.*]')

It is not working. Should it or am I completely wrong in my approach?


Using jquery, how can I select all the DIVs in my document with ID names containing specific text?
===

Using jquery, how can I select all the DIVs in my document with ID names containing specific text?

I want to select all the elements that contain 'parent', the problem is the string parent might be in the middle of the string.

I've been trying to use:
    
    var allcontent_collection = $('div[id^=.*parent.*]')

It is not working. Should it or am I completely wrong in my approach?

