Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <script type='text/javascript'>
  4.             window.onload = function() {
  5.                 document.getElementById('prime_button').onclick = function() {
  6.                     var prime = 'primes/' + document.getElementById('prime_in').value + '/'
  7.                     location.href = prime
  8.                 }
  9.  
  10.                 document.getElementById('gcd_button').onclick = function() {
  11.                     var lo = document.getElementById('gcd_in1').value
  12.                     var hi = document.getElementById('gcd_in2').value
  13.                     var href = 'gcd/' + lo + '/' + hi + '/'
  14.                     location.href = href
  15.                 }
  16.             }
  17.         </script>
  18.     </head>
  19.  
  20.     <body>
  21.         <div>
  22.             <input type='text' id='prime_in' placeholder='high' />
  23.             <input type='button' id='prime_button' value='primes' />
  24.         </div>
  25.         <div>
  26.             <input type='text' id = 'gcd_in1' placeholder='lo' />
  27.             <input type='text' id = 'gcd_in2' placeholder='hi' />
  28.             <input type='button' id = 'gcd_button' value='gcds' />
  29.         </div>
  30.     </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement