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


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.


                <h1><span>Delete this part once you copy/paste the following ID:</span> <span id="secretID">...</span></h1>

<div id="main">
  <input type="text" name="name" placeholder="name">
  <input type="email" name="email" placeholder="email">
  <button type="submit">Contact Us</button>




                // Initialize Firebase our database, you don't have to touch this part
var firebaseConfig = {
    apiKey: "AIzaSyBHcN0HVMwxxW-xBkXHYAm2X-kGWjxPzNk",
    authDomain: "",
    databaseURL: "",
    projectId: "basiccrud-ffe19",
    storageBucket: "",
    messagingSenderId: "47974982638",
    appId: "1:47974982638:web:9a034202ca787ee47764ff"
function getUniqueId() { //a silly function just to let you fork this codepen and have your own database
  var CODEPEN_ID = /[codepen|cdpn]\.io\/[^/]+\/(?:pen|debug|fullpage|fullembedgrid)\/([^?#]+)/;
  var id;
  if(CODEPEN_ID.test(window.location.href)) {
    id = CODEPEN_ID.exec(window.location.href)[1];
  } else if (CODEPEN_ID.test(document.location.href)){
    id = CODEPEN_ID.exec(window.location.href)[1];
  } else {
    var metas = document.getElementsByTagName('link');    
    for(i=0;i<metas.length;i++) {
      if(metas[i].getAttribute('rel') == 'canonical') {
        id = CODEPEN_ID.exec(metas[i].getAttribute('href'))[1];  
  return id || `randoDB${Math.floor(Math.random()*10000000)}`;

//this is the "handler" for YOUR database where we can store and read values from anyone at your site!
let yourID = getUniqueId();
let yourDatabase = firebase.database().ref("contactform").child(yourID);

$("form").on("submit", function(evt){
  let data = JSON.parse(JSON.stringify( $("form").serializeArray() ));
  let newEntry = yourDatabase.push();
  $("#main").html(`Thank you for contacting us ${data[0].value}!`);
  return false;