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.


    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">

    <div class="wrapper">
        <div class="container">
                <h1>JS Documentation</h1>
                <section class="topic">
                    <a href="#Introduction">
                    <a href="#what-you-should-already-know">
                        <h3>What you should already know</h3>
                    <h3><a href="#javascript-and-java"> JavaScript and Java</a></h3>
                    <h3><a href="#hello-world">Hello World</a> </h3>
                    <h3>Declaring Variables</h3>
                    <h3>Global variables</h3>
                    <h3>Data Types</h3>
                    <h3>if...else statement</h3>
                    <h3>while statement</h3>
                    <h3>Funtion Declaration</h3>

            <section class="details">

                <h1 id="Introduction">Introduction</h1>
                <p class="description">
                    JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight
                    language. Inside a host environment (for example, a web browser), JavaScript can be connected to the
                    objects of its environment to provide programmatic control over them.
                <p class="description">JavaScript contains a standard library of objects, such as Array, Date, and Math,
                    and a core set of language elements such as operators, control structures, and statements. Core
                    JavaScript can be extended for a variety of purposes by supplementing it with additional objects;
                    for example:</p>
                <ul class="important-point">
                    <li>Client-side JavaScript extends the core language by supplying objects to control a browser and
                        its Document Object Model (DOM). For example, client-side extensions allow an application to
                        place elements on an HTML form and respond to user events such as mouse clicks, form input, and
                        page navigation.</li>
                    <li>Server-side JavaScript extends the core language by supplying objects relevant to running
                        JavaScript on a server. For example, server-side extensions allow an application to communicate
                        with a database, provide continuity of information from one invocation to another of the
                        application, or perform file manipulations on a server.</li>

                <h1 id="what-you-should-already-know">What you should already know</h1>
                <p class="description">This guide assumes you have the following basic background:</p>
                <ul class="important-point">
                    <li>A general understanding of the Internet and the World Wide Web (WWW).</li>
                    <li>Good working knowledge of HyperText Markup Language (HTML).</li>
                    <li>Some programming experience. If you are new to programming, try one of the tutorials linked on
                        the main page about JavaScript.</li>

                <h1 id="javascript-and-java">JavaScript and Java</h1>
                <p class="description">JavaScript and Java are similar in some ways but fundamentally different in some
                    others. The JavaScript language resembles Java but does not have Java's static typing and strong
                    type checking. JavaScript follows most Java expression syntax, naming conventions and basic
                    control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.</p>
                <p class="description">In contrast to Java's compile-time system of classes built by declarations,
                    JavaScript supports a runtime system based on a small number of data types representing numeric,
                    Boolean, and string values. JavaScript has a prototype-based object model instead of the more common
                    class-based object model. The prototype-based model provides dynamic inheritance; that is, what is
                    inherited can vary for individual objects. JavaScript also supports functions without any special
                    declarative requirements. Functions can be properties of objects, executing as loosely typed
                <p class="description">JavaScript is a very free-form language compared to Java. You do not have to
                    declare all variables, classes, and methods. You do not have to be concerned with whether methods
                    are public, private, or protected, and you do not have to implement interfaces. Variables,
                    parameters, and function return types are not explicitly typed.</p>
                <h1 id="hello-world">Hello world</h1>
                <p class="description">To get started with writing JavaScript, open the Scratchpad and write your first
                    "Hello world" JavaScript code:</p>
                <p class="code">
                    <code class="code">function greetMe(yourName) { alert("Hello " + yourName); }
                <p class="description"> Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!
                <h1 class="heading">Data types</h1>
                <p class="description">The latest ECMAScript standard defines seven data types:</p>
                <ul class="important-point">
                    <li>Six data types that are primitives:
                        <ul class="important-point">
                            <li>Boolean. true and false.</li>
                            <li>null. A special keyword denoting a null value. Because JavaScript is case-sensitive,
                                null is not the same as Null, NULL, or any other variant.</li>
                            <li>undefined. A top-level property whose value is undefined.</li>
                            <li>Number. 42 or 3.14159.</li>
                            <li>String. "Howdy"</li>
                            <li>Symbol (new in ECMAScript 2015). A data type whose instances are unique and immutable.
                    <li>and Object</li>



                :root {
::after {
  box-sizing: border-box;
body {
  margin: 0;
  min-width: 290px;
  color: #4d4e53;
  background-color: #ffffff;
  font-family: "Open Sans", Arial, sans-serif;
  line-height: 1.5;

.container {
  /* padding: 0 1rem; */
h3 {
  border-top: 1px solid #aaa;
  padding: 0.9rem 1rem;
  margin: 0;

/* h3::before{
    content: '> ';
    font-size: 1em;
} */
.description {
  font-weight: 400;
  margin: 1rem 0 0 1rem;
  /* padding: 1rem; */
.details {
  padding: 1rem;

li {
  /* line-height: 2; */
  margin: 1rem 0 0 0;

.code {
  background-color: #ddd;
  margin: 1rem 2rem auto 2rem;
  /* padding: 1rem; */
  /* padding: auto 2rem; */
  height: 2rem;

header {
  /* width: 100%; */
  background-color: #eee;
  text-align: center;
  margin: 0;
  padding: 0;
header h1 {
  margin: 0;
  width: 100%;

.topic {
  height: 40vh;
  overflow-y: scroll;
  border: 2px solid #4d4e53;
a {
  text-decoration: none;
  color: inherit;
@media screen and (min-width: 670px) {
  .container {
    display: grid;

    grid-template-columns: 300px 1fr;
    grid-template-areas: "header details";
    grid-gap: 10px;
  header {
    grid-area: header;
    position: fixed;
    top: 0;
    left: 0;
  .topic {
    grid-area: topic;
    height: 100vh;
  .details {
    grid-area: details;
    margin-left: 1rem;