I am trying to add aria-label to all links that don't have it on the site. I want to use the link text as aria-label.
$(document).ready(function () {
$("a").each(function () {
var attr = $(this).attr('aria-label');
if (typeof attr == typeof undefined && attr == false) {
var txt = $(this).text();
$(this).attr("aria-label", txt);
}
});
});