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

              
                <div>
   <div style="padding: 24px 40px;">
     <p>You will need to edit the <code>js</code> and add your own <strong>Marketo POD ID</strong> and your <strong>Marketo Munchkin ID</strong>.</p>
  <p>The <code>css</code> will also need to be added into your bundle or added to your landing pages using a <code>style</code> tag</p>
  </div>
   <form id="mktoForm_1"></form>
</div>
              
            
!

CSS

              
                .mktoForm {
  visibility: hidden;

  &[data-styles-ready="true"] {
    visibility: visible;
  }
}
              
            
!

JS

              
                /*
 * @author Jeff Reiner
 * @version v2
 * @license MIT License: This license must appear with all reproductions of this software.
 *
 * Create a completely barebones, user-styles-only Marketo form
 * by removing inline STYLE attributes and disabling STYLE and LINK elements
 *
 * Updated version based off original here: https://codepen.io/figureone/pen/MbPOdj
 */

// take formId from the form element already on the page
var mktoFormId = document
  .querySelector('form[id^="mkto"]')
  .getAttribute("id")
  .replace("mktoForm_", "");

var mktoFormConfig = {
  podId: "YOUR POD ID",
  munchkinId: "YOUR MUNCHKIN ID"
};

// load the form from Marketo with our data 
MktoForms2.loadForm(
  mktoFormConfig.podId,
  mktoFormConfig.munchkinId,
  mktoFormId
);

// the function that destyles the existing form
function destyleMktoForm(mktoForm, moreStyles) {
  var formEl = mktoForm.getFormElem()[0];

  // remove element styles from <form> and children
  var styledEls = Array.from(formEl.querySelectorAll("[style]")).concat(formEl);

  styledEls.forEach(el => el.removeAttribute("style"));

  // disable remote stylesheets and local <style>s
  var styleSheets = Array.from(document.styleSheets);

  styleSheets.forEach(ss => {
    if (
      [mktoForms2BaseStyle, mktoForms2ThemeStyle].indexOf(ss.ownerNode) != -1 ||
      formEl.contains(ss.ownerNode)
    ) {
      ss.disabled = true;
    }
  });

  if (!moreStyles) formEl.setAttribute("data-styles-ready", "true");
}

// run the destyler function on the currnet marketo form
MktoForms2.whenRendered(form => destyleMktoForm(form));

// @NOTE: remove before use!!!
// this is a demo thing that prevents the form from submitting here for testing
// MktoForms2.whenReady(form =>
//   form.onSubmit(form =>
//     form.submittable(document.location.hash == "#enableForm")
//   )
// );
              
            
!
999px

Console