How do you select all id tags that contain a certain string in javascript?
<p>I have an ASP.NET application that renders multiple questions with the option to provide an explanation for the answers given.</p>

<pre><code>&lt;label for="[&lt;%:count %&gt;].AnswerExplanation_&lt;%: i+1 %&gt;" id="[&lt;%:count %&gt;].toggleExplanation_&lt;%: i+1 %&gt;"&gt;&lt;strong&gt;Add Explanation&lt;/strong&gt;&lt;/label&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div id="[&lt;%:count %&gt;].Explanation_&lt;%: i+1 %&gt;"&gt;
    &lt;textarea id="[&lt;%:count %&gt;].AnswerExplanation_&lt;%: i+1 %&gt;" name="[&lt;%:count %&gt;].AnswerExplanation_&lt;%: i+1 %&gt;" class="ckedit"&gt;&lt;/textarea&gt;
&lt;/div&gt;
</code></pre>

<p>so you will have id's like "[X].toggleExplanation_Y" corresponding to "[X].AnswerExplanation_Y"</p>

<p>I am writing a javascript function to show/hide the AnswerExplanation divs, and was looking for a way to select every id containing "toggleExplanation" I should be able to get the rest from there.</p>
