![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
Código:
Ese codigo lo hace perfectamente, pero si lo intento hacer con un iframe nada <SCRIPT> function add() { var div = document.createElement("div"); div.style.width = "100px"; div.style.backgroundColor = "#FFCC00"; body.appendChild(div); }; </SCRIPT> <BODY id="body"> <INPUT TYPE="button" VALUE="Append Child" onclick="add()"> </BODY>
![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
Código:
Pues eso .... <SCRIPT> var editor; function init() { editor = document.getElementById('editor').contentWindow.document; editor.designMode = "on"; }; function add() { var div = document.createElement("div"); div.style.width = "100px"; div.style.backgroundColor = "#FFCC00"; editor.appendChild(div); }; </SCRIPT> <BODY onLoad="init()"> <iframe id="editor"></iframe> <br> <INPUT TYPE="button" VALUE="Append Child" onclick="add()"> </BODY>