Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/05/2015, 13:00
Avatar de legomolina
legomolina
 
Fecha de Ingreso: junio-2011
Ubicación: Valencia
Mensajes: 165
Antigüedad: 12 años, 11 meses
Puntos: 3
Respuesta: Seleccionar todo el texto plano

Mmm, pues no me funciona... Me devuelve undefine
Código Javascript:
Ver original
  1. <html>
  2.     <head>
  3.  
  4.         <script>           
  5.             function search() {
  6.                 var texto = document.documentElement.innerText;
  7.                 console.log(texto); //undefined
  8.             }
  9.         </script>
  10.        
  11.     </head>
  12.     <body>
  13.         <input type="button" value="Find" onclick="search();" id="searchButton">
  14.  
  15.         Prueba<br>
  16.         <p>Prueba2</p>
  17.     </body>
  18. </html>