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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="container">
  <div class="row">
    <div class="col-xs-4"></div> 
    <div class="col-xs-4 text-center"> <b>Wikipedia Viewer For Encyclopedic Research</b> 
      <div class="input-field tooltipped" data-position="top" data-delay="100" data-tooltip="type below and enter"><input id="myText" placeholder="" class="validate text-center" type="text" autofocus></div>
      <div class="text-center">
        <a class="btn btn-info tooltipped z-depth-5" data-position="bottom" data-delay="100" data-tooltip="Grab a random article!" href="" target="_blank">anything</a>
        <a class="btn btn-info tooltipped z-depth-5" data-position="bottom" data-delay="100" data-tooltip="Featured Content" href="" target="_blank">Featured</a>
    <div class="col-xs-4"></div>


<div id="myContainer" class="container">
  <div id="result1" class="jumbotron z-depth-1"></div>
  <div id="result2" class="jumbotron z-depth-1"></div>
  <div id="result3" class="jumbotron z-depth-1"></div>
  <div id="result4" class="jumbotron z-depth-1"></div>
  <div id="result5" class="jumbotron z-depth-1"></div>
  <div id="result6" class="jumbotron z-depth-1"></div>
  <div id="result7" class="jumbotron z-depth-1"></div>
  <div id="result8" class="jumbotron z-depth-1"></div>
  <div id="result9" class="jumbotron z-depth-1"></div>
  <div id="result10" class="jumbotron z-depth-1"></div>

<footer class="center"><small>Written by </small><a href=""><small>S.L. Ting</small></a></footer>


                body {
  background-color: lightgreen;
  font-family: courier;
  margin-top: 10px;
  font-size: 1.2em;

::-webkit-input-placeholder {
  color: black;

.container .jumbotron {
  border-radius: 5px;
  font-weight: bold;
  color: black;
  background-color: lightgreen;


                $(document).ready(function() {

  Materialize.toast("Wikipedia Viewer", 7000);
  Materialize.toast("just type and enter to search" + "<br>" + "  or click ANYTHING", 5001);

    cache: false


  $(":input").keyup(function(e) {

    if (e.keyCode == 13) {
      var searchTerm, getFor;
      searchTerm = document.getElementById('myText').value;
      getFor = '' + searchTerm + '&callback=?';
      document.getElementById('myText').value = "";
      $.getJSON(getFor, function(json) {
        // Looping through page by page
        if (json.hasOwnProperty("query") == true) {

          var counter = 1,
            pageTitle, pageExtract, pageUrl;
          for (var page in json.query.pages) {
            pageTitle = json.query.pages[page].title;
            pageExtract = json.query.pages[page].extract;
            pageUrl = json.query.pages[page].fullurl;
            $("#result" + counter).html('<a href=\"' + pageUrl + '\" target=\"_blank\">' + pageTitle + '</a>' + '<br>' + pageExtract + '...');
          } // losing for looping through json pages
          Materialize.toast("enter to clear results or type to search anew", 4000);
          Materialize.toast("click title to open page", 4000);

        } else {
          if (searchTerm != "") {
            Materialize.toast("No results", 5000);
        } // closing for if else statement

      }); // closing for .getJSON

    } // belong to if statement 
  }); //belong to keyup input check for enter

}); // belong to document ready