SHARE
TWEET

Java project 1

Krissz Oct 3rd, 2017 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <title>Algoritmus</title>
  4.         <meta charset="UTF-8">
  5.         <link rel="stylesheet" type="text/css" href="css\style.css">
  6.         <script language="JavaScript">
  7.             function evenNumbers() {
  8.             var numbers = document.getElementsByClassName('formInput'),
  9.             evenNumbers = [];
  10.  
  11.             for (var i = 0, l = numbers.length - 1; i <= l; i++) {
  12.                 var num = +numbers[i].value;
  13.                 (num && num % 2 === 0) && evenNumbers.push(num);
  14.             }
  15.  
  16.             document.getElementById('even').innerHTML = (evenNumbers.length)
  17.             ? 'A páros számok: ' + evenNumbers.join(', ')
  18.             : 'Nincs páros szám!';
  19. }
  20.         </script>
  21.     </head>
  22.    
  23.     <body>
  24.         <div class="menu">
  25.             <ul>
  26.                 <li><a href="index.html">Kezdőlap</a></li>
  27.                 <li><a href="other.html" class="active">Algoritmus</a></li>
  28.             </ul>
  29.         </div>
  30.        
  31.         <div class="text">
  32.             <div class="pTitle">Algoritmus</div>
  33.             <form><p>
  34.             <input type="text" class="formInput"><br />
  35.             <input type="text" class="formInput"><br />
  36.             <input type="text" class="formInput"><br />
  37.             <input type="text" class="formInput"><br />
  38.             <input type="text" class="formInput"><br />
  39.             <input type="text" class="formInput"><br />
  40.             <input type="button" value="OK" class="c" onclick="evenNumbers()"/> <span id="even" ></span><br /><br />
  41.             </p>
  42.  
  43.         </form>
  44.        
  45.         </div>
  46.     </body>
  47. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top