<div class="block">
<header class="header">...</div>
<div class="slider">...</div>
<section class="main">...</section>
</div>
<div class="features">...<div>
<div id="first"></div>
<div id="second"></div>
<div id="third"></div>
$( document ).ready(function() {
var divs = ["first", "second", "third"];
var counter = 0;
});
function cycle(element) {
$(element).attr("href", divs[counter]);
if(counter < divs.length - 1) {
counter++;
}
else {
counter = 0;
}
}
<div><a onclick="cycle(this);" href="#first_div"></a></div>