JavaScript – A simple calculator with lots Bootstrap

Have you ever dreamt of making the simplest application for calculating two numbers?

Nope? Me also. But anyhow, I have started to make it only with JavaScript, without jQuery and it turned out to be fun after some time. That is the final result:

calculator

 

The interesting part about it, is that it uses cookies with JS. I have copied the code for the cookies from here with small editions – http://www.w3schools.com/js/js_cookies.asp. It worked pretty well.

Another thing to note in this example is the usage of “addEventListener”, which I managed to use pretty well. As a bad practice, must be mentioned the fact that the CSS, HTML and the JS is all in one file. But I somehow did not feel the need to separate it, because it was less than 200 lines all together.

I even made a small video, to test my maths skills here:

Pretty much that is all. Here comes the code:

Available also in GitHub here.

Enjoy it! 😀

Tagged with: , , ,