$(\'a[xlink\\\\:href=#coastline]\').attr(\'class\',\'grey\'); $(\'a[xlink\\\\:href=#onshore]\').attr(\'class\',\'blue-light\');
This is what I currentl
Maybe this is what you want Demo
$('a').each(function(i){ if($(this).attr('href') == "#coastline") $(this).addClass('gray'); if($(this).attr('href') == "#onshore") $(this).addClass('green'); if($(this).attr('href') == "") $(this).addClass('yello'); });