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.


                <div class="wrapper" >
      <div id ="screen"><h1>0</h1></div>
      <div class ="controls" id ="cbtn">
        <div class="row text-center">
          <button class="btn btn-default btn-lg">%</button>
          <button class="btn btn-default btn-lg">7</button>
          <button class="btn btn-default btn-lg">8</button>
          <button class="btn btn-default btn-lg">9</button>
          <button class="btn btn-default btn-lg">*</button>
        <div class="row text-center">
          <button class="btn btn-default btn-lg">+/-</button>
          <button class="btn btn-default btn-lg">4</button>
          <button class="btn btn-default btn-lg">5</button>
          <button class="btn btn-default btn-lg">6</button>
          <button class="btn btn-default btn-lg">-</button>
        <div class ="row text-center">
          <button class="btn btn-default btn-lg btn-danger">C</button>
          <button class="btn btn-default btn-lg">1</button>
          <button class="btn btn-default btn-lg">2</button>
          <button class="btn btn-default btn-lg">3</button>
          <button class="btn btn-default btn-lg">+</button>
        <div class="row text-center">
          <button class="btn btn-default btn-lg btn-danger" >AC</button>
          <button class="btn btn-default btn-lg" >0</button>
          <button class="btn btn-default btn-lg" >.</button>
          <button class="btn btn-default btn-lg" >=</button>
          <button class="btn btn-default btn-lg" >/</button>



  width: 375px;
  margin: 0 auto;
  margin-top: 20px;
  padding: 2%;
  background-color: grey;
  border-radius: 50px;
  background-color: red;
  margin: 0 auto;
  width: 440px;

#cbtn button{
  width: 61px;
  height: 70px;
  margin-bottom: 5px;

  width: 95%;
  height: 125px;
  padding: 30px;
  margin: 30px auto;
  text-align: right;
  background-color: #FFCC66;
  border-radius: 50px;



  programmer: Renato Francia
  Program: Simple calculator
  Purpose: Make of a simple calculator

main = function(){

  //Main variables
  var equation;
  var value;
  var parser;

  //default values
  equation = " ";
  parser = math.parser();

  //Check if any of the buttons in the control has been clicked
  $( "#cbtn button" ).click(function( event ) {
    value =;


    switch (value) {
      //Clear the history
      case 'AC':
      case 'C':
        equation = "";
        $("#screen").html("<h1>"+equation+"</h1>" );

      //Evaluate the statement
      case '=':
        equation = parser.eval(equation);
        $("#screen").html("<h1>"+equation+"</h1>" );

      case '+/-':
        equation = '-1*' + equation;
        equation = parser.eval(equation);
        $("#screen").html("<h1>"+equation+"</h1>" );

        equation +=;
        $("#screen").html("<h1>"+equation+"</h1>" );

    }//end of switch