I have footer links on my website and I'm trying to get the title attributes of the anchor tag using the following method.
(function($){
$("#block-footermenu a.nav-link").each(function(e) {
console.log($(e).attr('title'));
});
})(jQuery);
but in the console, I'm getting undefined what I'm missing here?
Following is my HTML
<nav role="navigation" aria-labelledby="block-footermenu-menu" id="block-footermenu" class="block block-menu navigation menu--footer-menu">
<ul class="nav ul_align">
<li class="nav-item">
<a class="nav-link" title="Sitemap" href="/us/sitemap">Sitemap</a>
</li>
</ul>
</nav>