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="header" id="header">
  <h1 class="searchHeader">Wiki</h1>
  <form class="inputbox">
    <input type="text" id="search" placeholder="Search">

<div class="container">
  <div id="results">
    <div class="result1">
      <h2 id="title1"></h2>
      <p id="snippet1"></p>
      <a id="link1" href=""></a>
    <div class="result2">
      <h2 id="title2"></h2>
      <p id="snippet2"></p>
      <a id="link2" href=""></a>
    <div class="result3">
      <h2 id="title3"></h2>
      <p id="snippet3"></p>
      <a id="link3" href=""></a>
    <div class="result4">
      <h2 id="title4"></h2>
      <p id="snippet4"></p>
      <a id="link4" href=""></a>
    <div class="result5">
      <h2 id="title5"></h2>
      <p id="snippet5"></p>
      <a id="link5" href=""></a>

<div class="footer" id="footer">


                html, body {
  margin: 0px;
  height: 100%;
  font-family: 'Montserrat', sans-serif;

.container {
  height: 20%;
  display: grid;
  grid-template-columns: 10% auto 10%;
  grid-template-rows: auto;

#header {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ffec94;
  font-size: 2em;
  height: 20%;

#search {
  margin-left: 5px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 0px;
  background-color: #ffaeae;
  height: 30px;
  width: auto;
  border: none;
  border-radius: 50px;
  font-size: 0.7em;
  outline-width: 0;


#results {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, auto);

.result1 {
  background-color:  #ffaeae;

.result2 {
  background-color: #fff0aa;

.result3 {
  background-color: #b0e57c;

.result4 {
background-color: #b4d8e7;

.result5 {
 background-color: #56baec;

.footer {
  background-color: #ffec94;
  height: 60%;



                $(document).ready(function() {

  //Search .inputbox autocomplete suggestion function:
    source: function(request, response) {
        url: "",
        dataType: "jsonp",
        data: {
          'action': "opensearch",
          'format': "json",
          'search': request.term
        success: function(data) {


  //clear .inputbox when user clicks .inputbox
  document.getElementById("search").addEventListener("click", function() {
    document.getElementById("search").value = "";

  //perform search when user keys down "Enter"
  document.getElementById("search").addEventListener("keydown", function() {
    if (event.keyCode == 13) {
      event.preventDefault();  //prevent page reload
      document.getElementById("ui-id-1").style.display="none";  //hide autocomplete box

 //perform search when user clicks on autocomplete suggestion
  document.getElementById("ui-id-1").addEventListener("click", function() {

  //clear previous results.
  function clearPage() {

    var speed = 1000;
    var easing = "easeInOutSine";
    $("#header, #footer").animate({height: "auto"}, speed, easing);
    $(".container").animate({height: "80%"},speed, easing);







  function searchWiki() {
    const textInput = document.getElementById('search');
    const textInBox = search.value;
    var url = "|pageterms&titles="+ textInBox+ "&search=" + textInBox;

      type: "GET",
      url: url,
      dataType: "json",
      success: function(data){

        var queryResults = data.splice(1);  //remove query from returned array
        var titleArray = queryResults[0];
        var title1 = "\"" + titleArray[0] + "\"";
        var title2 = titleArray[1];
        var title3 = titleArray[2];
        var title4 = titleArray[3];
        var title5 = titleArray[4];

        var snippetArray = queryResults[1];
        var snippet1 = snippetArray[0];
        var snippet2 = snippetArray[1];
        var snippet3 = snippetArray[2];
        var snippet4 = snippetArray[3];
        var snippet5 = snippetArray[4];

        var linkArray = queryResults[2];
        var link1 = linkArray[0];
        var link2 = linkArray[1];
        var link3 = linkArray[2];
        var link4 = linkArray[3];
        var link5 = linkArray[4];

        $("#link1").attr('href', link1);

        $("#link2").attr('href', link2);

        $("#link3").attr('href', link3);

        $("#link4").attr('href', link4);

        $("#link5").attr('href', link5);