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.


  <link rel="stylesheet" href="">
    <title>Get access to the DOM</title>
    <div class="container">
      <header id="page-header" class="bg-dark text-white col-sm-12">
        <h1 id="main-heading" class="text-center">Get access to the DOM</h1>
      <div class="row">
        <main class="col-sm-8">
          <article id="art-001" class="m-2 p-2 border border-secondary">
            <h3>Article 001</h3>
              Ask to be pet then attack owners hand jumps off balcony gives owner dead mouse at present then poops in litter box snatches yarn and fights with dog cat chases laser then plays in grass finds tiny spot in cupboard and sleeps all day jumps in bathtub and meows when owner fills food dish the cat knocks over the food dish cat slides down the water slide and into pool and swims even though it does not like water or meowzer,
          <article id="art-002" class="m-2 p-2 border border-secondary">
            <h3>Article 002</h3>
              Attack dog, run away and pretend to be victim hunt by meowing loudly at 5am next to human slave food dispenser cough furball so all of a sudden cat goes crazy. Stare at ceiling light. Meow scream at teh bath missing until dinner time, yet human is washing you why halp oh the horror flee scratch hiss bite or scratch at fleas, meow until belly rubs,
          <article id="art-003" class="m-2 p-2 border border-secondary">
            <h3>Article 003</h3>
              Try to hold own back foot to clean it but foot reflexively kicks you in face, go into a rage and bite own foot, hard stares at human while pushing stuff off a table chase dog then run away. Jump on human and sleep on her all night long be long in the bed, purr in the morning and then give a bite to every human around for not waking up request food,
        <aside id="sidebar" class="col-sm-4 bg-info text-white">
    <script src="./scripts.js"></script>




                // Get access to the DOM
const articles = document.getElementsByTagName('article');
const paragraphs = document.getElementsByTagName('p');
const firstArticle = articles[0];
const secondParagraph = paragraphs[1];
const whiteTextElements = document.getElementsByClassName('text-white');
const sidebar = document.getElementById('sidebar');

// Modify the DOM
const mainHeading = document.getElementById('main-heading');
mainHeading.textContent = 'Modify the DOM';

const header = document.getElementById('page-header');
header.innerHTML = '<h2>Modify the DOM</h2>';