Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

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


                <h3 class="total-document"></h3>
<h3 class="total"></h3>
<h3 class="direct"></h3>
<h3 class="second"></h3>
<h3 class="third-link"></h3>

    <li>List Item One.<a href="link/inside.html">Link One.</a></li>
    <li>List Item Two.</li>
    <li>List Item Three.</li>
    <li>List Item Four.</li>
  <p>First Paragraph.</p>
  <p>Second Paragraph.</p>
  <p>Third <span>Something <a href="link/para.html"> Para Link</a></span> Paragraph.</p>
  <h4>First Heading.</h4>
  <p>Last Paragraph.</p>
  <button>Finally a Button!</button>


                body {
  width: 600px;
  font-family: 'Dosis';
  font-size: 1.2em;

section * {
  padding: 10px;

li {
  list-style: none;

button {
  border: none;
  border: 1px solid gray;


                $("section *").css("background-color", "rgba(0,0,255,0.3)");

var totalDocumentCount = $("*").length;
$(".total-document").text("Total Elements in the document : " + totalDocumentCount);

var allCount = $("section *").length;
$(".total").text("Total Section Descendants : " + allCount);

var directCount = $("section > *").length;
$(".direct").text("Total Direct Descendants : " + directCount);

var secondCount = $("section > * > *").length;
$(".second").text("Total 2nd level Descendants : " + secondCount);

var thirdLinkCount = $("section > * > * a").length;
$(".third-link").text("Total 3nd level Links : " + thirdLinkCount);