jquery - get attributes of an element when clicked . The element contains inner divs so getting undefined error
<p>I have the html code like this : </p>

<pre><code>&lt;ul&gt;
  &lt;li k="5" id="l"&gt;
    &lt;div&gt;
        &lt;div&gt;
         Some Text
        &lt;/div&gt;
    &lt;/div&gt;   
  &lt;/li&gt;
&lt;/ul&gt; 
</code></pre>

<p>From the above code, if I dont have any div's or spans or someother elements inside the <strong>li</strong> tag, then $(e.target).attr("k") will give correct value . But, as it has some other elements inside it, when I click the element, it gives undefined value . What is the solution ? </p>
