selectors via jquery
<p>Is there any way to write the following code working with innerHTML in the compact platform-independent way (probably using jquery)?</p>

<p>The point is that IE names tags in different case in innerHTML, so I need two if clauses to handle that. toLowerCase does not help when it comes to quotes.</p>

<pre><code>var flagpos = html.indexOf('&lt;/a&gt;')
if (flagpos == -1) flagpos = html.indexOf('&lt;/A&gt;')

html = (flagpos &gt;= 0) ?
  '&lt;span class="' + html.substr(flagpos + 4).
  replace(/^\s*|\s*$/, '').
  replace(/ /g, '"&gt;&lt;/span&gt;&lt;span class="') +
  '"&gt;&lt;/span&gt;' + res + ' ' + html.substr(0, flagpos + 4) : res + ' ' + html
</code></pre>

<p>-- or --</p>

<pre><code>if (!toggleFlags[j] ||
    child.innerHTML.indexOf('&lt;span class="' + j + '"&gt;') &gt;= 0 ||
    child.innerHTML.indexOf('&lt;SPAN class=' + j + '&gt;') &gt;= 0) continue
</code></pre>
