Advertisement
xxxxbe

exampleAdd

Feb 1st, 2020
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.87 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.   <meta charset="UTF-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.   <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8.   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  9.   <title>Document</title>
  10.   <style media="screen">
  11.           div {
  12.         border: 1px blue dashed;
  13.         display: inline-block;
  14.         width: 305px;
  15.         padding: 10px 10px 10px 10px;
  16.       }
  17.   </style>
  18. </head>
  19.  
  20. <body>
  21.  
  22.       <div class="form-group">
  23.           <div class="col-sm-6">
  24.             <label for="nomUser">Usuario:</label>
  25.             <input type="text" id="nomUser">
  26.           </div>
  27.           <div class="col-sm-6">
  28.             <label for="nomUser">Contrase&ntilde;a:</label>
  29.             <input type="text" id="nomUser">
  30.           </div>
  31.         </div>
  32.         <br />
  33.         <div class="form-group" id="form">
  34.           <div class="col-sm-6">
  35.             <label for="nomUser">Calle:</label>
  36.             <input type="text" id="nomUser">
  37.           </div>
  38.           <div class="col-sm-6">
  39.             <label for="nomUser">Casa:</label>
  40.             <input type="text" id="nomUser">
  41.           </div>
  42.       </div>
  43.  
  44.       <button onclick="clonar();">Agregar mas restaurantes</button>
  45.     <br />
  46.     <br />
  47.     <div id="contenedor"></div>
  48.  
  49.  
  50. </body>
  51.  
  52. <script type="text/javascript">
  53.         function clonar() {
  54.             cantidad = 0;
  55.             myForm = document.getElementsByTagName('div');
  56.             cant = myForm.length;
  57.             clonForm = myForm[0].cloneNode(true);
  58.             clonForm.id = "form" + cant;
  59.            
  60.             document.getElementById("contenedor").appendChild(clonForm);
  61.   }
  62. </script>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement