JQuery .attr("title") undefined
<p><strong>Solved</strong> but the answer that contained a key debugging suggestion was deleted by author. Consider case closed.</p>

<p>This should be really simple, but for some reason I just cannot figure it out. I need to get the value of a div's title attribute, and the JQeury code I have is:</p>

<pre><code>var name = $('#stg'+this.id).attr('title');
</code></pre>

<p>and the div in the relevant HTML source code is:</p>

<pre><code>&lt;div class="stage" id="stg32432432" title="Name - desc"&gt;...&lt;/div&gt;
</code></pre>

<p>For some odd reason, request for <code>attr("title")</code> keeps returning <code>undefined</code>, even though <code>attr("id")</code> and <code>attr("class")</code> all return expected values with no issues. What am I missing?</p>

<p><strong>Edit</strong>: I tried debugging it with a trick suggested in a (now deleted) reply:</p>

<pre><code>var name = $('#stg'+this.id)[0].outerHTML;
</code></pre>

<p>and lo and behold, it shows:</p>

<pre><code>&lt;div class="stage" id="stg32432432"&gt;...&lt;/div&gt;
</code></pre>

<p>Something ate my title! Everything else is exactly as I expected, but the title is missing. Too bad I cannot mark that reply as correct, as I think from here on I can trace where the attributes gets annihilated. </p>

<p><strong>Update</strong>: it turned out that a third party library used for displaying titles as fancy tooltips was stripping the titles as it processed them. Mystery resolved.</p>

<p>Thanks to all.</p>
