Hola
aruizroldan
Prueba este código:
Código PHP:
<html>
<head>
<script type="text/javascript">
txt = ['texto 1','texto 2','texto 3','texto 4','texto 5'];
indice = 0;
function mover(dire) {
if (dire==0) {
indice--;
if (indice<0) indice=txt.length-1;
}
else {
indice++;
if (indice>txt.length-1) indice=0;
}
document.getElementById('texto').innerHTML = txt[indice];
}
</script>
</head>
<body>
<span id="texto">texto 1</span>
<input type="button" value="<" onclick="mover(0)" />
<input type="button" value=">" onclick="mover(1)" />
</body>
</html>
Saludos,