title: Count the number of times a string occurs in a parent div in javascript or jquery
body: <p>I have a parent div named "master_ts1891_tab_2901" with many child divs under it. I need a function that would return the number of times the string "No Records Found" occurs in the entire parent div.</p>
  
  <p>This string may be under any child div. Note that the string "No Records Found" is a simple text.</p>
  
  <p>Since the entire code is huge, I have addded the sample markup.</p>
  
  <p>Here a code sample:</p>
  
  <pre><code>&lt;div id="master_DefaultContent_rts_ts1891_tab_2901"&gt;
      &lt;div id="master_DefaultContent_rts_ts1891_s5928" class="section ViewEditSection  hidden" layoutid="5928"&gt;
          &lt;div id="master_DefaultContent_rts_ts1891_s5928_up"&gt;
          ...
          ...many more divs and tables
          ...
              &lt;td colspan="8" style="text-align:left;"&gt;&lt;div&gt;No Records Found&lt;/div&gt;&lt;/td&gt;
  
          ...many more divs and tables
          ...
              &lt;td colspan="8" style="text-align:left;"&gt;&lt;div&gt;No Records Found&lt;/div&gt;&lt;/td&gt;
      &lt;div&gt;
  </code></pre>
  
  <p></p>
  
  <p>jquery or javascript both will do.</p>
  
  <p>Please help me out.</p>