how to get the id of a div when using jquery hasClass method?
<p>This code is not working:</p>

<pre><code>           $("div").hasClass("testSection").attr("id");
</code></pre>

<p>I get the following error message:</p>

<pre><code>        TypeError: $(...).hasClass(...).attr is not a function
</code></pre>

<p>Any idea what could be the problem</p>
