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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <html >
  <meta charset="UTF-8">
  <script src=""></script>
  <link rel="stylesheet" href="css/style.css">

    <link rel='stylesheet prefetch' href=''>
  input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: searchfield-cancel-button;

  <div class="container">
  <div class="mo-title mo-box text-center">
        <button id="mo-random" class="btn btn-primary mo-button"> Random!
  <div class="form-group">
    <input type="search" class="form-control" placeholder="Search" id="search" />
<div class="mo-results">
 <div class="mo-credit mo-box text-center">
  by <a href="">Mark Daniel Osborne</a>

<div class="mo-log">

    <script src="js/index.js"></script>



  background: #66AAFF;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    padding:0 15px 0 15px;

    font-family:  sans-serif;
    font-size: 50px;
    padding:10px 15px 10px 15px;


    background-size: 100px;
    background-repeat: no-repeat;
     background-position: center;



    font-family:  sans-serif;
    font-size: 15px;


#searchClear {
    position: absolute;
    right: 5px;
    top: 0;
    bottom: 0;
    height: 14px;
    margin: auto;
    font-size: 14px;
    cursor: pointer;
    color: #CCC;



    border-radius: 8px;
    margin-top: 15px;
    padding:10px 15px 10px 15px;


    font-size: 25px;  
Button for random wikipedia entry
Search field
Show results


Objective: Build a app that is functionally similar to this:

Fulfill the below user stories. Use whichever libraries or APIs you need. Give it your own personal style.

User Story: I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.

User Story: I can click a button to see a random Wikipedia entry.

Hint #1: Here's a URL you can use to get a random Wikipedia article: var popup = $"about:blank", "_blank");

Hint #2: Here's an entry on using Wikipedia's API:

Hint #3: Use this link to experiment with Wikipedia's API:


var randomWiki = function () {
  var win ='', '_blank')
  if (win) {
      //Browser has allowed it to be opened
  } else {
      //Browser has blocked it
      alert('Please allow popups for this website')
  var searchWiki = function(searchTerm) {
    addLog("Searching Wiki for "+searchTerm)
       // .getJSON(url,data,success)
   // jHXR .done, .fail, .always
  addLog("Running getJSON...");
  var CORS = ""
  var wikiURL = CORS+""
  $.getJSON( wikiURL,{ action: 'query', list: 'search', srsearch: searchTerm, format: 'json' },
       addLog("Done 1...");  
       for (var result of search) {
         var resultLink = ""+result.title
         var resultBlock = "<a href=\""+resultLink+"\" target=\"_blank\">"
         resultBlock += "<div class=\"mo-result-box\"><p class = \"mo-result-title\"><b>"+result.title+"</b></p>"
         resultBlock += result.snippet

         resultBlock+="</div></a> "
     //function() {addLog("Done 2...");}
         function( jqXHR, textStatus, errorThrown )
          var errText = "Fail...<BR>"+textStatus+"<BR>"+errorThrown+"<BR>"
    //function() {addLog("Always...");}

$(document).ready(function() {
  addLog("Document Ready")

  )// addeventlistener
    if ((e.keyCode || e.which) == 13) {


var addLog = function(msg) {

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.