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.


Auto Save

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.


                <!-- les éléments -->
<!-- les attributs data-* sont libres ; leurs valeurs pourront être lues en javascript via la propriété “dataset”  -->
<button data-show="#paragraphe_1">Mon 1er élément</button>
<button data-show="#paragraphe_2">Mon 2nd élément</button>
<button data-show="#paragraphe_3">Mon 3e élément</button>

<!-- les paragraphes, cachés grace à CSS -->
<p id="paragraphe_1">Mon paragraphe 1</p>
<p id="paragraphe_2">Mon paragraphe 2</p>
<p id="paragraphe_3">Mon paragraphe 3</p>



                p {
  opacity: 0;
  transition: opacity 500ms
p.visible {
  opacity: 1;


                // sélectionne tous les `button` dotés d’un attribut “data-show”
// voir “sélecteurs d’attribut” :
const elements = document.querySelectorAll('button[data-show]');

// pour chaque bouton :
elements.forEach((element) => {

  element.onmouseover = () => {
    // on enregistre l’id de l’élément cible, 
    // stocké dans l’attribut data-show de l’élément
    var target_selector =;
    // on sélectionne cet élément
    var target = document.querySelector(target_selector);
    // on lui ajoute la class “visible”

  element.onmouseout = () => {
    var target_selector =; 
    var target = document.querySelector(target_selector);