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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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 form">
  <form onsubmit="wikiSearch(event)">
    <input id="search" type="text" name="search"><button type="submit" >Search</button>
  <a target="_blank" href="">Random Article</a>
<div class="container">
  <div id="results"></div>



                .form {
  text-align: center;
  margin: 0 auto;
  margin-top: 10vh;
form {
  margin-top: 25px;
  margin-bottom: 5px;
button {
  border-radius: 0 30px 30px 0;
  border: none;
  font-size: 17px;
input {
  border-radius: 30px 0 0 30px;
input:focus {
  outline: none;
  box-shadow: 0 0 2pt 1pt grey;
button:focus {
  border: none;
  outline: none;
  box-shadow: 0 0 2pt 1pt grey;



                var wikiData;
var page = "//";

//This function fires when the form is submited. Either by the click of the 'search' button or by pressing the enter button.
function wikiSearch(event) {
  event.preventDefault(); //prevents query from clearing too early
  var query = document.getElementById("search").value;

  //URL information for API call
  var api =
  //API get request to wikipedia
  $.getJSON(api + query).then(data => {
    wikiData = data.query.pages;
    draw(); //Calls the draw function once the data is retrived

//The draw method cycles through the JSON data recieved from wikipedia and prints it to the screen.
function draw() {
  var template = "";
  Object.keys(wikiData).forEach(function(key) {
    template += `
      <div class="row">
        <div class="col-xs-12">
              <h3><a href=${page + wikiData[key].pageid} target="_blank">${
  document.getElementById("results").innerHTML = template; //Set results section equal to the template
  document.getElementById("search").value = ""; // reset the search form to empty string