daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Nov 20th, 2018 75 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3.     <head>
  4.         <title>szyfr cezara</title>
  5.         <meta charset="utf-8" />
  6.     </head>
  7.     <body>
  8.     <textarea id="message" rows="5" cols="40" ></textarea><br />
  9.     <button id="encode">Szyfruj</button> <button id="decode">Odszyfruj</button><br />
  10.     <textarea id="cipher" rows="5" cols="40"></textarea>
  11.    
  12.  
  13.    
  14.     <script>
  15.         document.getElementById('encode').addEventListener('click',function(){
  16.             var message = document.getElementById('message').value;
  17.             var cipher = document.getElementById('cipher');
  18.             cipher.value = ' ';
  19.             for(var i=0; i < message.length; i++)
  20.                 cipher.value += String.fromCharCode(message.charCodeAt(i)+3)
  21.                
  22.                     });
  23.                 document.getElementById('decode').addEventListener('click',function(){
  24.             var cipher = document.getElementById('cipher').value;
  25.             var message = document.getElementById('message');
  26.             message.value = ' ';
  27.             for(var i=0; i < cipher.length; i++)
  28.                 message.value += String.fromCharCode(cipher.charCodeAt(i)-3)
  29.                
  30.                
  31.                
  32.                
  33.                
  34.                
  35.                
  36.                
  37.            
  38.    
  39.         });
  40.     </script>
  41.     </body>
  42. </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