How to determine which selector is selected from among the rest?
<p>I have following code:</p>

<p><strong>HTML:</strong></p>

<pre><code>// import jQuery

&lt;tr id = "tr_id"&gt;
  &lt;td&gt;something&lt;/td&gt;
  &lt;td&gt;something&lt;/td&gt;
&lt;/tr&gt;

&lt;div&gt;
  &lt;span class = "cls"&gt;something&lt;/span&gt;
  &lt;a id="a_id" href="#"&gt;something&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p><strong>JavaScript:</strong></p>

<pre><code>var result;
$("tr, .cls").on("click", function(){

    if (/* selector is "tr" */) {
      result = $(this).attr("id");
    } else{
      result = $(this).closest("a").attr("id");
    }

});
</code></pre>

<hr>

<p>Now I want to know how can I write a condition in this <code>if</code> statement?</p>

<pre><code>if (/* selector is "tr" */) {
</code></pre>