вопросы для детского сада))
<html>
<head>
<title>example</title>
</head>
<body>
<div>
<a class="selected">1</a>
<a class="selected">2</a>
<a class="no-selected">3</a>
<a class="selected">4</a>
</div>
<script>
var list = document.querySelectorAll('a[class=selected]'),
a;
for (var i = 0; i < list.length; ++i)
{
a = list[i];
alert(a.innerHTML);
}
</script>
</body>
</html>