jquery object to the string
<pre><code>$("h2.trigger").click(function(){
            console.log($(this));

            $(this).toggleClass("active").next().slideToggle("slow");
            var viewName=$(this).attr('id');

            //display approval list ajax method
            var html="";
</code></pre>

<p>I'm currently working on a jQuery application and do a <code>console.log($(this));</code> </p>

<p>In Firefox it prints</p>

<blockquote>
  <p>[h2#vw_hs_hr_wf_admin_data.trigger]    this is a object               </p>
</blockquote>

<p>We can not take it as a plain string as it returns <code>Object object</code>. I would like to assign the <code>"h2#vw_hs_hr_wf_admin_data.trigger"</code> as a plain text to a JavaScript variable.</p>

<p>I tried </p>

<pre><code>alert($(this).id); 
alert($(this).0); 
</code></pre>

<p>but I have no luck.</p>
