Advertisement
cdsatrian

append textarea

Jun 21st, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.62 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
  4.   </head>
  5.   <body>
  6.     <select id="pilih" name="pilih">
  7.       <option value="">default</option>
  8.       <option value="1">1</option>
  9.       <option value="2">2</option>
  10.       <option value="3">3</option>
  11.     </select>
  12.     <div id="container">
  13.     </div>
  14.   </body>
  15.   <script type="text/javascript">
  16.     $('#pilih').change(function(){
  17.       var jml=$('#pilih').val();
  18.       for(var i=0;i<jml;i++){
  19.        $('#container').append("<textarea></textarea>");
  20.       }
  21.     });
  22.   </script>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement