daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.   <meta name="viewport" content="width=device-width">
  6.   <title>JS Bin</title>
  7. <style id="jsbin-css">
  8. #jokeknap:hover {
  9.   cursor: pointer;
  10. }
  11. </style>
  12. </head>
  13. <body>
  14.   <h1 id="overskrift">Bratcsh</h1>
  15.   <p id="joke"></p>
  16.   <a id="jokeknap" onclick="nyjoke();">hahaha</a>
  17. <script id="jsbin-javascript">
  18. JOKES = [ "her er en bratsch-joke"
  19.         , "her er en mere"
  20.         ]
  21.  
  22.  
  23. function set_joke(joke){
  24.   document.getElementById("joke").innerHTML = joke;
  25. }
  26.  
  27. function nyjoke(){
  28.   var joke = random_joke();
  29.   set_joke(joke);
  30. }
  31.  
  32. function random_joke(){
  33.   return JOKES[Math.floor(Math.random()*JOKES.length)];
  34. }
  35.  
  36. window.onload = function(){nyjoke();}
  37. </script>
  38.  
  39.  
  40. <script id="jsbin-source-css" type="text/css">#jokeknap:hover {
  41.   cursor: pointer;
  42. }</script>
  43.  
  44. <script id="jsbin-source-javascript" type="text/javascript">JOKES = [ "her er en bratsch-joke"
  45.         , "her er en mere"
  46.         ]
  47.  
  48.  
  49. function set_joke(joke){
  50.   document.getElementById("joke").innerHTML = joke;
  51. }
  52.  
  53. function nyjoke(){
  54.   var joke = random_joke();
  55.   set_joke(joke);
  56. }
  57.  
  58. function random_joke(){
  59.   return JOKES[Math.floor(Math.random()*JOKES.length)];
  60. }
  61.  
  62. window.onload = function(){nyjoke();}</script></body>
  63. </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