title: Using custom xml elements with JQuery
body: <p>Given the following:</p>
  
  <pre><code>&lt;p&gt;This is a &lt;fund id="12345"&gt;Test Fund&lt;/fund&gt;. More text.&lt;/p&gt;
  </code></pre>
  
  <p>How do I extract the text ("Test Fund") from the fund element?</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>$('fund').each(function(index) {
  
      alert($(this).text());
  
  });
  </code></pre>
  
  <p>I can retrieve the id attribute as follows:</p>
  
  <pre><code>alert($(this).attr("id"));
  </code></pre>
  
  <p>I have had no luck with text() html() etc.</p>
  
  <p><strong>EDIT:</strong>
  Initially I had only tried IE8, But after test in firefox I discover it works with FF just fine. I then reviewed in IE dev tools and noticed that the Dom explorer was treating the opening tag as a stand-alone node, as well as doing this to the remaining text, and closing tag.</p>
  
  <p>I found some info on using a custom namespace as follows:</p>
  
  <pre><code>&lt;html xmlns:myns&gt;
  &lt;head&gt;
  &lt;title&gt;Test&lt;/title&gt;
  &lt;script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
         // Your code here
         $('myns:fund').each(function(index) {
              alert(index + ': ' + $(this).attr("id"));
          });
       });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;Sample paragraph.&lt;/p&gt;
  &lt;p&gt;This is a &lt;myns:fund id="12345"&gt;Test Fund&lt;/fund&gt;. More text.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This fails also but renders correctly in the IE DOM explorer.</p>