Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/08/2014, 11:30
Avatar de AitorDB
AitorDB
 
Fecha de Ingreso: agosto-2014
Ubicación: Cádiz, España
Mensajes: 52
Antigüedad: 9 años, 9 meses
Puntos: 5
Respuesta: Reemplazar un texto por otro texto

En sustitución de innerHTML tiene html simplemente si usaras JQuery:

Código HTML:
Ver original
  1. <script src="http://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript"></script>
  2. var ES = ["Hola",
  3.           "Azul"];
  4.  
  5. var EN = ["Hello",
  6.           "Blue"];
  7.  
  8.  
  9. function Idioma(Valor){
  10.  
  11.     if(Valor == "ES"){
  12.         $('#Texto1').html(ES[0]);
  13.         $('#Texto2').html(ES[1];
  14.     }
  15.  
  16.     else {
  17.         $('#Texto1').html(EN[0]);
  18.         $('#Texto2').html(EN[1]);
  19.     }
  20.  
  21. }
  22.  
  23. <select name="idioma" onchange="Idioma(this.value)">  
  24.     <option value="ES">Espa&ntilde;ol</option>
  25.     <option value="EN">English</option>                
  26.  
  27. <div id="Texto1">Hola</div>
  28. <div id="Texto2">Azul</div>

Para el caso de usar BBDD + PHP te adjunto un [URL="http://www.desarrolloweb.com/articulos/2353.php"]enlace[/URL] a un tutorial bastante fácil .

Suerte!