Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 11th, 2012  |  syntax: HTML  |  size: 0.65 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!doctype html>
  2. <html>
  3.   <head>
  4.     <title>Gas price calculator</title>
  5.         <meta charset="utf-8" />
  6.         <script>
  7.            function calculate(){
  8.               document.getElementById("answer").innerHTML=
  9.                     document.getElementById("litres").value*1.382+" euros is the price you have to pay for this amount of 95 octane gas.";
  10.            }
  11.         </script>
  12.   </head>
  13.   <body>
  14.      <h1>Gas price calculator</h1>
  15.          <h4>(Octane number 95  - price as of 10th September)</h4>
  16.          <div>
  17.            How many litres you want to buy:
  18.            <input type="text" id="litres" />
  19.            <input type="button" value="Enter" onclick="calculate()" />
  20.          </div>
  21.          <div id="answer">
  22.          
  23.          </div>
  24.   </body>
  25. </html>