title: how to call jQuery(this) from anchor tag onclick function
body: <p>I have</p>
  
  <pre><code> &lt;ul&gt;
              &lt;li&gt;&lt;a onclick="setSelectedTestPlan();" href="javascript:void(0);"&gt;New Test&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a onclick="setSelectedTestPlan();" href="javascript:void(0);"&gt;New Test fdgfdgfdgfdgfdgfdgfdgfdg fdg&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a onclick="setSelectedTestPlan();" href="javascript:void(0);"&gt;New Plan&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a onclick="setSelectedTestPlan();" href="javascript:void(0);"&gt;Test&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  </code></pre>
  
  <p>code and wants to add class name to a tag parrent tag li i.e. <code>class="selected"</code> bu sing jquery.
  I used this jquery code</p>
  
  <pre><code>function setSelectedTestPlan() {
          jQuery("#tree ul li").each(function () {
              jQuery(this).removeClass("selected");
          });
  
          jQuery(this).closest('li').addClass("selected");
      }
  </code></pre>
  
  <p>But this line <code>jQuery(this).closest('li').addClass("selected");</code> doesn't work...</p>
  
  <p>Please help me out...</p>