Is there any way to get the value of the aria-label using jQuery?
I have this function
$(document).ready(function() {
console.log("dom ready")
$(document).on('click', '.clicker', function(e) {
e.preventDefault();
e.stopPropagation();
var hrefValue = this.href;
var label = this.aria - label;
var id = this.id;
console.log("aria label " + label);
fire(hrefValue)
});
});
Which works if I want to get the hrefValue from this dropdown:
<a class="dropdown-toggle rootelements clicker" role="button" aria-label="'+elem.appname+'" data-toggle="dropdown" data-toggle="tooltip" title=' + elem.link + ' href="' + elem.value +'"><i style="color:' + elem.iconcolor + ';" class="' + elem.icon + '" id="jsonicon"></i></a>
But this console.log("aria label " +label)
Returns aria label NaN for me when expected output is debug
https://api.jquery.com/attr/
var label = $(this).attr('aria-label');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With