io farei cosi'
codice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript"> function Oggetto(width, height) { this.div = document.createElement('div'); this.div.style.width = width + "px"; this.div.style.height = height + "px"; this.div.style.backgroundColor = "#cccccc"; } window.onload=function() { oggetto = new Oggetto(200, 100) document.getElementById("qui").appendChild(oggetto.div); } </script> </head> <body> <div id="qui"> </div> </body> </html>

Rispondi quotando