This is possible, I know I'm on the way, but before I decide to see with the community what can be done in this case, and then take the right direction.
Code
function Selecionado(tag){
var item = document.getElementById('menu');
var link = item.getElementsByTagName('a');
for ( var i = 0; i < link.length; i++ ){
link[i].style.backgroundColor = "";
link[i].style.color = "";
}
tag.style.backgroundColor = "#ff0000"; // Cor de fundo do link
tag.style.color = "#ffffff"; // Cor atual do link
}
* { margin: 0; padding: 0; list-style: none; }
button { float: left }
#menu li {
float: left;
margin: 5 10px;
position: relative;
}
a {
cursor: pointer; padding: 3px; text-decoration: none; color: #111;
}
a.ativo {
font-weight: bolder;
background-color: #333;
color: #fff;
}
<button id="menos">« Voltar</button>
<ul id="menu">
<li><a onclick="Selecionado(this);">1</a></li>
<li><a onclick="Selecionado(this);">2</a></li>
<li><a onclick="Selecionado(this);">3</a></li>
<li><a onclick="Selecionado(this);">4</a></li>
<li><a onclick="Selecionado(this);">5</a></li>
</ul>
<button id="mais">Avançar »</button>
It has the whole logic in one function and the menu item that will be highlighted, will have its font color changed as well as the background
For this, I only need to read the id less / more to know what direction to take.
In practice you need to give these buttons motion in a way that one menu item is selected at a time, as each click
See an example - Page Header
Detail
I need examples in simple language without APIs, DOM4 and ECMAScript 5
They are not extensively compatible with various browsers (obsolete)