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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <link href="" rel="stylesheet">

<header class="text-center">
  <h1>jQuery Calculator</h1>
  <h3> By BERTINI Nickolas</h3>

<div class="calculator container-fluid ">
  <div id="calcOutput" class="text-center">
    <span id="steps">0</span>
  <div id="keyboard">
    <div class="row">
      <a class="btn btn-danger col" id="deleteAll">AC</a>
      <a class="btn btn-danger col" id="backOne">CE</a>
      <a class="btn btn-primary col" id="%">%</a>
      <a class="btn btn-primary col" id="/">/</a>      
        <div class="row">
      <a class="btn btn-primary col num" id="7">7</a>
      <a class="btn btn-primary col num" id="8">8</a>
      <a class="btn btn-primary col num" id="9">9</a>
      <a class="btn btn-primary col" id="*">*</a>      
        <div class="row">
      <a class="btn btn-primary col num" id="4">4</a>
      <a class="btn btn-primary col num" id="5">5</a>
      <a class="btn btn-primary col num" id="6">6</a>
      <a class="btn btn-primary col" id="-">-</a>      
        <div class="row">
      <a class="btn btn-primary col num" id="1">1</a>
      <a class="btn btn-primary col num" id="2">2</a>
      <a class="btn btn-primary col num" id="3">3</a>
      <a class="btn btn-primary col" id="+">+</a>      
        <div class="row">
          <div class="col-6 borderZero">
            <a class="btn btn-primary num col zero" id="0">0</a>
            <a class="btn btn-primary col num" id=".">.</a>
            <a class="btn btn-primary col" id="=">=</a>    

              html, body {
  font-family: "Oswald";
background: #e1eec3;  /* fallback for old browsers */
background: -webkit-linear-gradient(to top, #f05053, #e1eec3);  /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to top, #f05053, #e1eec3); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

header {

.calculator {
  width: 20vw;
  min-width: 300px;
  background-color: black;
  margin-bottom: 50px;

#calcOutput {
  border: solid 2px black;
  font-size: 2em;
  margin-top: 20px;

#keyboard {

.btn {
  height: 50px;
  margin: 5px;
  font-size: 1.5em;

  background-color: lightblue;

              $(document).ready(function() {
  var inputs = [];
  var totalString;
  var operators=["+","-","*","/","%"];
  //Add value and check validations
  function getValue (input) {
    // Check for don't start with an operator
    if(inputs.length === 0 && operators.includes(input)) {
      console.log("start with operator");
    // Check for double operator
    } else if (operators.includes(inputs[inputs.length-1]) && operators.includes(input)) {
      console.log("double operator");
    // Check for double "."
    } else if (inputs[inputs.length-1] === "." && input === ".") {
      console.log("double ..");
    } else {
  function getTotal() {
    totalString = inputs.join("");
  function update() {
  totalString = inputs.join("");
  $("a").on("click", function() {
    if( === "deleteAll") {
      inputs = [];
    } else if ( === "backOne") {
    } else if ( === "=") {
    } else {
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.