Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <button onclick="mere()">Tryk</button>
  2.  
  3. <form name="holder">
  4.  
  5. <input type="text" class="challenge" name="challenge[]" size="10"><br/>
  6.  
  7. </form>
  8.  
  9. var a = [1, 2, 3, 4, 5, 6]
  10.  
  11. function mere() {
  12. var inputs = document.getElementsByClassName( 'challenge' ),
  13. names = [].map.call(inputs, function( input ) {
  14. return input.value;
  15. }).join( '|' );
  16.  
  17.  
  18. if (inputs > 0){
  19. a.push.apply(a, inputs);
  20. console.log(inputs);
  21. }
  22. else {
  23. alert("empty")
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement