why is nbsp converted before using indexof? And what does $(<html_section_id>).select... do?
<p>I wanted to ask 2 questions about below code:</p>

<pre><code>var tabName = 'Resolution';
      var tabSection = $('tabs2_section').select('h3[class="tab_header"]');
      var indexOfTabName = 0;
      for (i = 0; i &lt; tabSection.length; i++) {
            var inner = tabSection[i].innerHTML.replace(/\x26nbsp;/g, ' ');
            if(inner.indexOf(tabName) &gt; -1) {
                  indexOfTabName = i;
                  break;
            }
      }
</code></pre>

<p>Above code finds the index of a tab within a section.</p>

<p>The questions I wanted to ask are:</p>

<ol>
<li><p>what does the following line do:</p>

<pre><code>var tabSection = $('tabs2_section').select('h3[class="tab_header"]');
</code></pre></li>
<li><p>why does it seem necessary to replace <code>&amp;nbsp;</code> <code>(\x26nbsp;)</code> with a regular space, as done on following line:</p>

<pre><code>var inner = tabSection[i].innerHTML.replace(/\x26nbsp;/g, ' ');
</code></pre></li>
</ol>

<p>cheers</p>
