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.


      input(type="button" value="C" id="cKey")
      input(type="text" id="screen")
      input(type="button" value="7" id="key")
      input(type="button" value="8" id="key")
      input(type="button" value="9" id="key")
      input(type="button" value="+" id="key")
      input(type="button" value="4" id="key")
      input(type="button" value="5" id="key")
      input(type="button" value="6" id="key")
      input(type="button" value="-" id="key")
      input(type="button" value="1" id="key")
      input(type="button" value="2" id="key")
      input(type="button" value="3" id="key")
      input(type="button" value="*" id="key")
      input(type="button" value="0" id="key")
      input(type="button" value="." id="key")
      input(type="button" value="/" id="key")
      input(type="button" value="=" id="equals")
      input(type="button" value="(" id="key")
      input(type="button" value=")" id="key")


  height: 100%
  background: white
  background: radial-gradient(circle, #fff 20%, #ccc)
  background-size: cover

  background-color: transparent
  text-align: center
  margin: 150px auto
  width: 250px
  height: 370px
  background: linear-gradient(darkcyan, darkseagreen)
  border-radius: 10px 25px 50px
  box-shadow: 0px 0px 1px gray
  border: 1px black
  text-align: right
  font: bold
  color: grey
#key, #cKey, #equals
  border: 0
  width: 40px
  height: 35px
  margin-top: 20px
  margin-left: 10px
  background: rgba(35, 70, 70, 0.50)
  color: cyan
  cursor: pointer
  border-radius: 100%


                $(document).ready(function() {

  // If any key except for the C key or = key is pressed
  $("[id=key]").click(function() {
    // Add its value to the screen
    calculator.screen.value += $(this).val();

  // If the C key is pressed
  $("#cKey").click(function() {
    // Clear the screen
    calculator.screen.value = "";

  // If the = key is pressed
  $("#equals").click(function() {
    // Evaluate the expression
    calculator.screen.value = eval(calculator.screen.value);