Código:
en los div uso el evento onClick<script type="text/javascript"> function changeText(idElement){ switch(idElement){ case 1: var unoHTML = document.getElementById('element'+idElement).innerHTML var dosHTML = "<span style='color:#ff0000'>" + unoHTML + "</span>" document.getElementById('element'+idElement).innerHTML = dosHTML break case 2: var tresHTML = document.getElementById('element'+idElement).innerHTML var cuatroHTML = "<span style='color:#ff0000'>" + tresHTML + "</span>" document.getElementById('element'+idElement).innerHTML = cuatroHTML break case 3: var cincoHTML = document.getElementById('element'+idElement).innerHTML; var seisHTML = "<span style='color:#ff0000'>" + cincoHTML + "</span>" document.getElementById('element'+idElement).innerHTML = seisHTML break } } </script>
Código HTML:
<div id="element1" class="info"><?php echo $lang['text_109']; ?></div><div class="arrow"><a class="arrow" href="#" onclick="cargarContenido('uno.php'); changeText(1)"/></a></div> <div id="element2" class="info"><?php echo $lang['text_99']; ?></div><div class="arrow"><a class="arrow" href="#" onclick="cargarContenido('dos.php'); changeText(2)"/></a></div> <div id="element3" class="info"><?php echo $lang['text_100']; ?></div><div class="arrow"><a class="arrow" href="#" onclick="cargarContenido('tres.php');changeText(3)"/></a></div>
alguien me puede decir algo. gracias.