cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <body>
  <div class="row">
    <div class="col m6 offset-m3">
      <div class="card light-blue lighten-2">
        <div class="card-content white-text">
          <span class="card-title">Random Dad Jokes</span>
          <h4 id="quote"></h4>

        <div class="row">
          <div class="col m3 offset-m9" id="joke-button">
            <button type="button" class="btn light-blue lighten-1 flow-text" id="getJoke">next</button>
              </div>
            </div>
          </div>
      </div>
    </div>
  </div>


  <div class="page-footer m12">
    <span id="bottom-footer">API from <a href="https://icanhazdadjoke.com/"> https://icanhazdadjoke.com/</a></span>
  </div>
  
<!--             <a href="https://twitter.com/share" class="twitter-share-button" id="tweet-joke">tweet</a> -->

</body>
            
          
!
            
              body {
  background-color: #0277bd;
}

.card {
  position: relative;
  top: 230px;
}


button {
  position: relative;
  left: 30px;
  top: 20px;
}


#bottom-footer {
  position:relative;
  bottom: 8px;
  color: white;
}

.page-footer {
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  text-align: center;
  background-color: #01579b;
}

a {
  color:white;
}








            
          
!
            
              function getJoke() {
$.getJSON("https://icanhazdadjoke.com/", function(json) { 
      var dadJoke = json.joke;
          $("#quote").html('"' + dadJoke + '"');
      });
}

$(document).ready(function() {
  getJoke();
  
  $("#getJoke").on("click", getJoke);

  $('#tweet-joke').on('click', function() {
    openURL('https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text='  + encodeURIComponent('"' + dadJoke + '"'));
  });          
    
});




            
          
!
999px
Loading ..................

Console