Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/05/2008, 06:05
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Respuesta: Leer contenido de la página con JavaScript

Hola icisneros

Un pequeño ejemplo:

Código:
<html>
<head>
<script type="text/javascript">
function ini() {
  obj = document.body;
  txt = obj.innerHTML;
  alert(txt);
}
</script>
</head>
<body onload="ini()">
<p>Este es un mensaje de prueba</p>
<p>Se autodestruirá en 5 segundos</p>
</body>
</html>
Si tienes el contenido dentro de un <div> cambia: obj = document.body;

por: obj = document.getElementById('IdDelDiv');

Saludos,