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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

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.

            
              <div class="quote-box">
    <center>
      <h3>Simple <i class="fa fa-wikipedia-w"></i>ikipedia Viewer</h3>
      <br>
        <button class="btn button">
    <a href="https://en.wikipedia.org/wiki/Special:Random" target="_blank">
    Click here for a random Wikipedia page!
    </a>
   </button>
        <br><br> or search for a keyword of your choice below!
        <br><br>
        <div class="input-group">
            <input id="txt-search" type="text" class="form-control" placeholder="search on Wikipedia..." value="" />
            <span id="btn-search" class="btn input-group-addon">
        <i class="fa fa-search"></i>
    </span>
    </div>
    </center>
    
    <div id="search-results">

    </div>
</div>
</div>
<div class="footer"> by <a href="https://id.linkedin.com/in/jacky-efendi-094643a1">jackyef</a>
    <br/>
    <a href="https://id.linkedin.com/in/jacky-efendi-094643a1" target="_blank"><button class="button btn "><i class="fa fa-linkedin"></i></button></a>
    <a href="https://instagram.com/_u/jackyef_"><button class="button btn " target="_blank"><i class="fa fa-instagram"></i></button></a>
    <a href="https://facebook.com/zhouyongchao"><button class="button btn " target="_blank"><i class="fa fa-facebook"></i></button></a>

</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Raleway:400,500);
* {
  margin: 0;
  padding: 0;
  list-style: none;
  vertical-align: baseline;
}

div {
  position: relative;
  z-index: 2;
}


body {
  background-color: #333;
  color: #333;
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
}

.footer {
  width: 450px;
  text-align: center;
  display: block;
  margin: 15px auto 30px auto;
  font-size: 0.8em;
  color: #fff;
}
.footer a {
  font-weight: 500;
  text-decoration: none;
  color: #fff;
}

.quote-box {
  border-radius: 3px;
  box-shadow: 3px;
  position: relative;
  margin: 2% auto auto auto;
  width: 450px;
  padding: 40px 50px;
  display: table;
  background-color: #fff;
}
.quote-box .quote-text {
  text-align: center;
  width: 450px;
  height: auto;
  clear: both;
  font-weight: 500;
  font-size: 1.75em;
}
.quote-box .quote-text i {
  font-size: 1.0em;
  margin-right: 0.4em;
}
.quote-box .quote-author {
  width: 450px;
  height: auto;
  clear: both;
  padding-top: 20px;
  font-size: 1em;
  text-align: right;
}
.quote-box .buttons {
  width: 450px;
  margin: auto;
  display: block;
}
.quote-box .buttons .button {
  height: 38px;
  border: none;
  border-radius: 3px;
  color: #fff;
  background-color: #333;
  outline: none;
  font-size: 0.85em;
  padding: 8px 18px 6px 18px;
  margin-top: 30px;
  opacity: 1;
  cursor: pointer;
}
.quote-box .buttons .button:hover {
  opacity: 0.9;
}
.quote-box .buttons .button#tweet-quote, .quote-box .buttons .button#tumblr-quote {
  float: left;
  padding: 0px;
  padding-top: 8px;
  text-align: center;
  font-size: 1.2em;
  margin-right: 5px;
  height: 30px;
  width: 40px;
}
.quote-box .buttons .button#new-quote {
  float: right;
}

.btn.button{
  font-weight: 600;
  background-color: #555;
}
.btn.button a{
  color: #eee;
}
            
          
!
            
              var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&callback=?&search=';

var keyword;
function search(){
  keyword = $('#txt-search').val();
  console.log(keyword);
  url = 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&callback=?&search=';
  url = url + keyword;
  $.getJSON(url, function(json){
      //json[0] contains the keyword entered 
    //json[1] contains every matching entries' titles
    //json[2] contains every matching entries' summary
    //json[3] contains every matching entries's URL
    var count = json[1].length;
    var i = 0;
    //clear search results
    $('#search-results').html('');
    $('#search-results').append("Keyword: " + keyword);
    
    $('#search-results').css('opacity', 0);
    var out;
    while(i < count){
      out = '';
      out += '<h3><a href=\"'+json[3][i] +'\" target=\"_blank\">'+ json[1][i] +'</a></h3>';
      out += '<p>'+json[2][i]+'</p>';
      $('#search-results').append(out);
      i++;
    }
    
    $('#search-results').animate({
        opacity: 1
      }, 500);
    
  });
  
}

$(document).ready(function() {
  $('#btn-search').on('click', search);
});
            
          
!
999px
Loading ..................

Console