Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <html>
  <head>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <title>Get access to the DOM</title>
  </head>
  <body>
    <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>
      </header>
      <div class="row">
        <main class="col-sm-8">
          <article id="art-001" class="m-2 p-2 border border-secondary">
            <h3>Article 001</h3>
            <p>
              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,
            </p>
          </article>
          <article id="art-002" class="m-2 p-2 border border-secondary">
            <h3>Article 002</h3>
            <p>
              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,
            </p>
          </article>
          <article id="art-003" class="m-2 p-2 border border-secondary">
            <h3>Article 003</h3>
            <p>
              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,
            </p>
          </article>
        </main>
        <aside id="sidebar" class="col-sm-4 bg-info text-white">
          <h4>Sidebar</h4>
        </aside>
      </div>
    </div>
    <script src="./scripts.js"></script>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                // 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
              
            
!
999px

Console