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.


                <script type="text/javascript">
  var _iub = _iub || [];
  _iub.csConfiguration = {
    "lang": "en",
    "siteId": 896537, //use your siteId
    "cookiePolicyId": 8207462, //use your cookiePolicyId
    gdprAppliesGlobally: false,
    countryDetection: true,
    logLevel: 'debug',
    banner: {
      "position": "float-bottom-center",
      "acceptButtonDisplay": true,
      "customizeButtonDisplay": true
    callback: {
      onReady: function() {
        document.getElementById('cc').innerHTML = || 'other countries outside EU';
        document.getElementById('banner-behaviour').innerHTML = ( === 'EU') ? 'SHOULD appear' : 'should NOT appear';
        document.getElementById('scripts-behaviour').innerHTML = ( === 'EU') ? 'WAIT for consent' : 'BE ACTIVATED regardless of consent'
      onPreferenceNotNeeded: function() {
        document.getElementById('consent-not-needed').style.display = 'block';
      onConsentGiven: function() {
        document.getElementById('consent-given').style.display = 'block';
<script type="text/javascript" src="//" charset="UTF-8" async></script> 

<!-- to ovveride country detection use this <script> instead (here we've forced EU): 

<script type="text/javascript" src="//" charset="UTF-8" onload=" = 'EU';" async></script> 

// = 'EU'; // European Union
// delete; // other countries


<h1>User detected from: <span id="cc">...</span></h1>
<p id="consent-not-needed" style="display:none">Consent is not needed</p>
<p>Banner <span id="banner-behaviour">...</span> on page load</p>
<p>The blocked scripts should <span id="scripts-behaviour">...</span></p>
<p id="consent-given" style="display:none">Consent has been given</p>
<p id="script-result">The scripts are waiting to be activated</p>

<script type="text/plain" class="_iub_cs_activate">
  document.getElementById('script-result').innerHTML = '👍 Scripts have been activated!';




                // do not copy this JS, only for demoing reasons

_iub.csConfiguration.skipSaveConsent = true; // do not save the consent, always shows banner