Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <div>
  10. <h1> Parim pela </h1>
  11. <p> Et mängu alustada vajuta "Submit nuppu"</p>
  12. </div>
  13. <form onSubmit="go();return false;">
  14. <input id="input-textbox" type="text" />
  15. <input type="submit" />
  16. </form>
  17. <textarea id="output-textbox" rows="20" cols="100"></textarea>
  18. <script>
  19.  
  20. textIn = document.getElementById("input-textbox");
  21. textOut = document.getElementById("output-textbox");
  22.  
  23. function process(input) {
  24. if(input == "Level 1"){
  25. return "1";
  26. }
  27.  
  28. if(input == "Level 2"){
  29. return "2";
  30. }
  31.  
  32. if(input == "Level 3"){
  33. return "3";
  34. }
  35.  
  36. if(input == "Level 4"){
  37. return "4";
  38. }
  39.  
  40. if(input == "Level 5"){
  41. return "5";
  42. }
  43.  
  44. if(input == "Level 6"){
  45. return "6";
  46. }
  47.  
  48. if(input == "Level 7"){
  49. return "7";
  50. }
  51.  
  52. if(input == "Level 8"){
  53. return "8";
  54. }
  55.  
  56. if(input == "Level 9"){
  57. return "9";
  58. }
  59.  
  60. if(input == "Level 10"){
  61. return "10";
  62. }
  63.  
  64.  
  65.  
  66.  
  67. }
  68.  
  69. function go() {
  70. var input = textIn.value;
  71. textIn.value = "";
  72. var output = process(input);
  73. textOut.value += output + "\n";
  74. }
  75.  
  76. </script>
  77. </body>
  78.  
  79. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement