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 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="flex-container">
  <div class="flex-item">
    <form onSubmit="Search(); return false;">
      <input type="text" class="form-control" id="keyword" placeholder="Enter the keyword...">
      <button class="btn btn-info">
        <i class="glyphicon glyphicon-search"></i>
      <button class="btn btn-info" id="random" onClick="RandomPage()">Good Luck</button>
  <div class="col-xs-8">
    <div class="row" id="result"></div>



                body {
  background-color: #E8E8E8;
  font-size: 140%;
  width: 100%;

.flex-container {
  height: auto;
  display: flex; 
  flex-flow: column wrap; 
  justify-content: center;
  align-items: center;

.flex-item {
  width: 80%;

form {
  position: relative;
  top: 260px;
  margin-bottom: 70px;
  text-align: center;

#keyword {
  width: 40%;
  display: inline-block;

.item {
  margin: 5px 0;
  padding: 0 13px 20px 13px;
  background-color: #FFFFFF;
  border: 1px #E0E0E0 solid;
  border-radius: 4px;
  color: #080808;

a div:hover {
  border-left: 8px #3E606F solid;


                function ShowResult(res) {
  var pages = res.query.pages;
  var url = "";
  if (true) {
      top: "40px"
    }, 750, function() {
      for (var pageId in pages) {
        $("#result").append("<a target='_blank' href='" 
                            + url + pages[pageId].pageid + "'>"
                            + "<div class='col-xs-12 item'><h3>"
                            + pages[pageId].title + "</h3>" 
                            + pages[pageId].extract + "</div></a>");

function Search() {
  var api = '';
  var keyword = $("#keyword").val();

    url: api,
    data: {
      action: 'query',
      format: 'json',
      generator: 'search',
      gsrnamespace: 0,
      gsrlimit: 10,
      prop: 'extracts',
      explaintext: 1,
      exintro: 1,
      exsentences: 1,
      exlimit: 'max',
      gsrsearch: keyword,
    dataType: 'jsonp',
    success: ShowResult

function RandomPage() {
  var url = "";;