Guest User

Untitled

a guest
Jan 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. <!--
  3.  
  4. function add_input(){ // Input erstellen
  5.     var wo = document.getElementById('wo');
  6.     var li = document.createElement('li');
  7.    
  8.     var input = document.createElement('input');
  9.         input.type = 'text';
  10.         input.name = 'antwort[]';
  11.        
  12.     li.appendChild(input);     
  13.     li.appendChild(document.createTextNode(' '));
  14.    
  15.     var button=document.createElement('input');
  16.         button.type = 'button';
  17.         button.className = 'button small';
  18.         button.onclick=function(){delete_input(this);};
  19.         button.value = 'loeschen';
  20.  
  21.     li.appendChild(button);
  22.     wo.appendChild(li);
  23. }
  24.  
  25. function delete_input(feld){ // Input loeschen
  26.     feld.parentNode.parentNode.removeChild(feld.parentNode);
  27. }
  28.  
  29. //-->
  30. </script>
Add Comment
Please, Sign In to add comment