arr = [];$('a').each(function (){if($(th…