I am working with Visual Studio 2010 C# and jQuery. On my web form I have one main div(divMain). Inside this div some children are created dynamically namely divValue0,divValue1....divValuen. I want to access each div whose id starts with divValue.
I am working with Visual Studio 2010 C# and jQuery . On my web
Share
Assuming I’ve understood your question correctly, you want to find all
divelements whoseidstarts with “divValue” that are children ofdivMain. If that’s right then something like this should work:It uses an “attribute starts-with” selector to match any element with an
idvalue starting with “divValue”. Thechildrenmethod returns all of the children of the selected element, but if you wanted descendants further down the DOM, you’ll have to usefindinstead.