Ver Mensaje Individual
  #6 (permalink)  
Antiguo 25/09/2010, 05:27
gumer
 
Fecha de Ingreso: octubre-2003
Ubicación: lima
Mensajes: 57
Antigüedad: 21 años, 5 meses
Puntos: 0
Respuesta: Editor Wysiwyng muy simple

Esta interesante el tema... como capturo ahora el texto del div... excelente maestro... ahora la sereza de la tarta;)
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title></title> 
<script> 
function formatText(cmd,v){ 
    document.execCommand(cmd, false, v); 
} 

function fnc000(){
  var msn = document.getElementById("pp").innerHTML;
  alert("HOLA: "+msn);
}
</script> 
</head> 

<body> 
<form action="" method="get"><input name="input" type="button" onclick="formatText('fontSize',1)" value="1" /><input name="input" type="button" onclick="formatText('fontSize',2)" value="2" /><input name="input" type="button" onclick="formatText('fontSize',3)" value="3" />
 
<div id="pp" contenteditable="true">Este es un texto editable</div>
<input type="button" name="alg" id="alg" value="enviar" onclick="fnc000()">
</form>
 
</body> 
</html>
Lo he probado, en iexplorer, mozilla y CHROME... funciona... me estan por salir lagrimas... no pedo crerlo... justo lo que necesitaba... SNIFT SNIFT....
__________________
GUMER FERNANDEZ HUATUCO
--------------------------------------
Solo hay un dio$

Última edición por gumer; 25/09/2010 a las 05:28 Razón: Comentario adicional