You can use
setInterval()
to change the border color every
N milliseconds. Store all colors you want in an array, and always pick the next element when changing the color, and go back to the first element when there are no elements left.
var milliseconds = 2000;
var colors = ["red", "green", "blue"];
var currentIndex = 0;
setInterval(function () {
var newColor = colors[currentIndex];
document.getElementById("yourArea").style.borderColor = newColor;
currentIndex++;
if (currentIndex >= colors.length) {
currentIndex = 0;
}
}, milliseconds);