Advertisement
Guest User

JavaScript Error

a guest
Jan 15th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title> Random Number Generator </title>
  6. </head>
  7. <style>
  8.     .lblstyle1 {
  9.         font-family: Arial;
  10.         font-size: 40px;
  11.         color: red;
  12.         text-align: Center
  13.     }
  14.  
  15.     .main_button {
  16.         background: linear-gradient(to bottom, #de0000 5%, #bd1b1b 100%);
  17.         background-color: #de0000;
  18.         border-radius: 28px;
  19.         border: 1px solid #e02040;
  20.         display: inline-block;
  21.         cursor: pointer;
  22.         color: #ffffff;
  23.         font-family: Arial;
  24.         font-size: 19px;
  25.         padding: 17px 34px;
  26.         text-decoration: none;
  27.         text-shadow: 0px 1px 0px #eb2154;
  28.         text-align: center;
  29.     }
  30.  
  31.         .main_button:hover {
  32.             background: linear-gradient(to bottom, #bd1b1b 5%, #de0000 100%);
  33.             background-color: #bd1b1b;
  34.         }
  35.  
  36.         .main_button:active {
  37.             position: relative;
  38.             top: 1px;
  39.         }
  40.  
  41.     .answerBlock {
  42.         border: 5px outset red;
  43.         text-align: center;
  44.         /*display: none;*/
  45.     }
  46.    
  47.     .answerLabel {
  48.         color: rgb(213, 16, 16);
  49.         font-family: Arial;
  50.         font-size: 30px
  51.     }
  52. </style>
  53.  
  54. <script>
  55. function getRandom() {
  56.     var random_step1 = Math.random *100;
  57.     var random_step2 = random_withdot.split(".")
  58.     //document.getElementsByClassName("answerBlock").display = block;
  59.     document.getElementById("answerText").innerHTML = "S";
  60. }
  61. </script>
  62. <body dir="rtl">
  63.     <h1 class="lblstyle1"> Random Number Generator </h1>
  64.     <p align="center">
  65.         <a href="#" onclick="getRandom()" class="main_button"> Generate Number Now </a>
  66.     </p>
  67.     <div class="answerBlock">
  68.         <h1 id="answerText" class="answerLabel">1</h1>
  69.     </div>
  70.     </body>
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement