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 lang="en">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/mystyle.css">
    <title>Hoxtygen Wiki Viewer Testing Page</title>

    <div class="wrapper">
        <div class="wiki-container">
            <div class="header">
                <h1 class="heading">WIKIPEDIA</h1>
            <strong class="subheading">The Free Encyclopedia</strong>
            <div class="wiki-logo-container">
                <div class="logo">
                    <img src="http://i38.photobucket.com/albums/e143/hoxtygen/Wikipedia-logo-v2_zpsf4mo20vr.png" alt="wikipedia logo" alt="wikipedia logo">
                <!-- logo closed-->
                <form id="searchForm" action="www.wikipedia.org/search-redirect.php" class="search-container">
                    <div class="input-container">
                        <input type="text" name="search" value="" id="searchBox" placeholder="Input search text" size="20" autofocus="autofocus"
                            autocomplete="on" class="search-box">
                    <div class="button-container">
                        <button type="button" class="btn btn-1" id="searchButton">Search Wiki</button>
                        <a href=" https://en.wikipedia.org/wiki/Special:Random" target="blank" type="button" class="btn">Get A Random Article</a>
            <!--  wiki logo container closed -->
        <!--wiki container closed -->
        <ul id="output">

    <!-- wrapper closed -->

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


              body        {
    background: #fff;
    font-size: 16px;
    line-height: 1.5;
    font-family: "Oxygen", sans-serif;

a           {
    font-family: "Oxygen", sans-serif;
    font-size: 20px;
    font-weight: 500;
    /* color: #222; */

a:hover, a:focus        {
    text-decoration: none;

.heading, .subheading            {
    font-family: "Rufina";
    /* font-variant: small-caps; */

.heading            {
    font-size: 2.5em;
    font-weight: 400;
    padding: .5rem 0;

.subheading         {
    display: block;
    margin-top: -1rem;
    font-size: 1.2em;
    font-weight: 400;

.wrapper            {
    width: 80%;
    margin: 0 auto;
    /* border: 1px solid #222; */

 .wiki-container    {
    min-height: 350px;
    padding-bottom: 50px;
    text-align: center;

.wiki-logo-container           {
    /* border: 1px solid mediumaquamarine; */
    width: 70%;
    margin: 0 auto;
    padding: 20px;

.search-container           {
    margin-top: 10px;

.search-box            {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #dbdbdb;
    width: 70%;
    margin: 10px auto;
    display: block;

.button-container           {
    /* border: 1px solid pink; */
    display: block;
    width: 70%;
    margin: 5px auto;
    text-align: center;
    padding: 10px 10px;

.button-container a    {
  color: #222;

.btn-1              {
    margin-right: 7px;

.btn            {
    border-radius: 3px;
    background: #eee;
    font-weight: 600;
    font-family: "oxygen";
    font-size: 13px;

.btn:hover        {
    color: #111;
    background: #ccc;

#output            {
    /* background: #f7f7f7; */
    color: #333;
    padding-top: 40px;
    padding-bottom: 35px;
    padding-right: 40px;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;

#output li      {
    list-style: none;
    padding: 15px;
    margin-bottom: 5px;
    font-size: 16px;
    margin-left: 0;
    background-color: whitesmoke;

#output li a           {
    font-family: "Oswald", sans-serif;
    font-size: 17px;
    font-weight: 400;

              document.addEventListener('DOMContentLoaded', function () {
  var searchBtn = document.getElementById('searchButton')
  document.querySelector('button').addEventListener('click', function () {
    var searchInput = document.getElementById('searchBox').value
    // console.log(searchInput)
    var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=json&redirects=return&origin=*&search=' + searchInput
    var request = new XMLHttpRequest()
    request.open('GET', url, true)
    request.onreadystatechange = function () {
      if (request.readyState === request.DONE && request.status === 200) {
        if (request.responseText) {
          var stringified = JSON.parse(request.responseText)
          var outputContainer = document.getElementById('output')
          outputContainer.innerHTML = "";
          for (var i = 0; i < stringified[1].length; i++) {
            var li = document.createElement('li')
            li.innerHTML = '<a target = "_blank" href = ' + stringified[3][i] + '>'+stringified[1][i] +"</a><p>" +stringified[2][i]+"</p>";
        } else {
          console.log('Error: Something is broken, cant fetch any data from the source specified');

🕑 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.