1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>  
  3.   <head>    
  4.     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">    
  5.     <meta name="generator" content="PSPad editor, www.pspad.com">    
  6.     <title>createElement Method    
  7.     </title>
  8. <script type="text/javascript">
  9.  
  10. function CreateElement() {
  11.         if(document.createElement){
  12.                 var el = document.createElement("DIV");
  13.                 el.id = "myDiv";    
  14.                 with(el.style){
  15.                         width = 500 + "px";
  16.                         color = "#ffff00";
  17.                         backgroundColor = "#000080";
  18.                         textAlign = "center";
  19.                         fontWeight = "bold"
  20.                         fontSize= 24 + "px";
  21.                         padding= 40 + "px";
  22.                 }
  23.                 el.innerHTML = "Congratulation , vous vennez de creer un element dynamiquement .!"
  24.                 document.body.appendChild(el);
  25.         }
  26. }
  27. </script>    
  28.     <style type="text/css">                    
  29.       <!--
  30.                         body {
  31.                             background-color: #666666;
  32.                         }
  33.                         -->        
  34.     </style>  
  35.   </head>  
  36.   <body>    
  37.     <div align="center" id="bout">      
  38.       <input type="button" onclick="CreateElement();" value="CLIC SUR CE BOUTON">    
  39.     </div>  
  40.   </body>
  41. </html>