Tag - javascript

How to develop an Simple HTML calculator using JavaScript and CSS – Part II

How to develop an Simple HTML calculator using JavaScript and CSS – Part I We have learned in our previous part of Simple HTML calculator using JavaScript and CSS about creating the structure of calculator using HTML and CSS. Now in this section we will implement the JavaScript in our structure. Lets start with adding JavaScript file “calculator.js” on the head section of html page. On top of JavaScript we will declare the variables which are required to complete the functions. var $ [...]

Read more...

How to toggle in JavaScript to show hide elements

In toggle function we will work on displaying FAQ’s section once user click on a particular link using JavaScript. If user will click on first faq it will show answer of that once. If user click on other faq question it will hide the first one and show the second answer. To achieve this functionality is very simple and can be done with just few line of code. To start with we are going to use below html code to [...]

Read more...

Simple Currency Change Maker in JavaScript

Simple currency change maker in JavaScript is a program with the help of which you can calculate how much change you need for particular amount. This program is helpful in understanding the use of If loop in JavaScript and also Math.floor function and use of modulus in JavaScript. Math.floor: The floor() method rounds a number to the nearest integer, and returns the result. You can learn more about the same at here. Modulus will give you reminder of the given value. In [...]

Read more...

Create a simple stopwatch in JavaScript with Start, Stop and Pause functionality

JavaScript stop watch can be developed using the JavaScript timing methods which are executed in time intervals. JavaScript timing methods automate a particular task to be done on the fly at particular interval without you having to click a button or call an event. JavaScript timing is made up of two key methods: setTimeout( “function”, milliseconds ); clearTimeout( ID name of setTimeout( ) ); How to create stop watch from start: Lets start creating stopwatch using javascript. We will create two files stopwatch.html and stopwatch.js [...]

Read more...