This should get you started.
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<script>
let link = new Array()
link[0] = "https://www.clc-uk.org.uk/cms/cms.jsp?menu_id=26131&postcode=AL3+8QE&distance=20"
link[1] = "https://www.clc-uk.org.uk/cms/cms.jsp?menu_id=26131&postcode=AL5+3NG&distance=20"
link[2] = "https://www.clc-uk.org.uk/cms/cms.jsp?menu_id=26131&postcode=AL5+3NS&distance=20"
let intlinkIndex = 0;
function writeLink() {
if ( intlinkIndex == link.length ) intlinkIndex = 0;
document.getElementById('mylink').innerHTML = '<a href="' + link[intlinkIndex] + '">' + link[intlinkIndex] + '</a>';
intlinkIndex++;
}
</script>
</head>
<body>
<button onclick="writeLink();">Click Me</button>
<div id="mylink"></div>
</body>
</html>
Slightly different function but does the same thing without the if.
function writeLink() {
let print = document.getElementById('mylink');
print.innerHTML = '<a href="' + link[intlinkIndex] + '">' + link[intlinkIndex] + '</a>';;
intlinkIndex = (intlinkIndex + 1) % (link.length);
}