I am trying to get a attribute value from my dom element, but i am getting result as:
Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'
I am not able to get the attribute value at all.. what is the issue..?
here my my code :
HTML:
<div class="label" aria-label="Logo">
<div class="trunc-string">
<div class="start denali-tooltip tooltip-on-truncate"><span>Logo</span></div>
</div>
</div>
jQuery:
var x = $("div.label")[0];
console.log (x.attr("aria-label"));
any one direct me in the right way please..?